@@ -106,6 +106,7 @@ exit(0);
106106 if (fork_pid == -1 ) {
107107 perror ("fork" );
108108 CTEST_ERR ("Failed to fork process." );
109+ free (a );free (b );free (c );free (d );
109110 } else if (fork_pid == 0 ) {
110111 // Compute a DGEMM product in the child process to check that the
111112 // thread pool as been properly been reinitialized after the fork.
@@ -117,14 +118,17 @@ exit(0);
117118 if (fork_pid_nested == -1 ) {
118119 perror ("fork" );
119120 CTEST_ERR ("Failed to fork nested process." );
121+ free (a );free (b );free (c );free (d );
120122 exit (1 );
121123 } else if (fork_pid_nested == 0 ) {
122124 check_dgemm (a , b , d , c , n );
125+ free (a );free (b );free (c );free (d );
123126 exit (0 );
124127 } else {
125128 check_dgemm (a , b , d , c , n );
126129 int child_status = 0 ;
127130 pid_t wait_pid = wait (& child_status );
131+ free (a );free (b );free (c );free (d );
128132 ASSERT_EQUAL (wait_pid , fork_pid_nested );
129133 ASSERT_EQUAL (0 , WEXITSTATUS (child_status ));
130134 exit (0 );
@@ -134,6 +138,7 @@ exit(0);
134138 // Wait for the child to finish and check the exit code.
135139 int child_status = 0 ;
136140 pid_t wait_pid = wait (& child_status );
141+ free (a );free (b );free (c );free (d );
137142 ASSERT_EQUAL (wait_pid , fork_pid );
138143 ASSERT_EQUAL (0 , WEXITSTATUS (child_status ));
139144 }
0 commit comments