tests: Fix two memory leaks
PATCH 1/3 tests: Fix two memory leaks
Although both leaks are not really important, fix them to avoid cppcheck warnings:
tests/linux-test.c:433: error: Memory leak: stack1 tests/linux-test.c:433: error: Memory leak: stack2
Signed-off-by Stefan Weil <[email protected]>
--- tests/linux-test.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
tests/linux-test.c +2 -0
@@ -426,7 +426,9 @@ void test_clone(void) CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, "hello2"));while (waitpid (pid1, &status1,0 ) != pid1); +free (stack1);while (waitpid (pid2, &status2,0 ) != pid2); +free (stack2);if (thread1_res !=5 || thread2_res !=6 )error ("clone" );
Signature · 1 line
1.7.2.3
Aurelien Jarno
AppliedQuoted 10 lines · Stefan Weil
Although both leaks are not really important, fix them to avoid cppcheck warnings:
tests/linux-test.c:433: error: Memory leak: stack1tests/linux-test.c:433: error: Memory leak: stack2Signed-off-by Stefan Weil <[email protected]>--- tests/linux-test.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Thanks, applied.
Quoted 19 lines
tests/linux-test.c +2
-0@@ -426,7 +426,9 @@ void test_clone(void) CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, "hello2"));while (waitpid (pid1, &status1,0 ) != pid1); +free (stack1);while (waitpid (pid2, &status2,0 ) != pid2); +free (stack2);if (thread1_res !=5 || thread2_res !=6 )error ("clone" );Signature · 1 line
1.7.2.3
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net