]> git.proxmox.com Git - qemu.git/commitdiff
tests: Fix two memory leaks
authorStefan Weil <weil@mail.berlios.de>
Fri, 21 Jan 2011 21:49:29 +0000 (22:49 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 20 Feb 2011 17:45:08 +0000 (18:45 +0100)
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 <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tests/linux-test.c

index 9986e299b21b1de521a3f9bcdf65c59194033ecc..2e4a746ac3b94311a5717528a8750019c2f37b6e 100644 (file)
@@ -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");