* [Qemu-devel] [PATCH 1/3] tests: Fix two memory leaks
@ 2011-01-21 21:49 Stefan Weil
2011-02-20 17:44 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2011-01-21 21:49 UTC (permalink / raw)
To: QEMU Developers
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>
---
tests/linux-test.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tests/linux-test.c b/tests/linux-test.c
index 9986e29..2e4a746 100644
--- a/tests/linux-test.c
+++ b/tests/linux-test.c
@@ -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");
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] tests: Fix two memory leaks
2011-01-21 21:49 [Qemu-devel] [PATCH 1/3] tests: Fix two memory leaks Stefan Weil
@ 2011-02-20 17:44 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2011-02-20 17:44 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Fri, Jan 21, 2011 at 10:49:29PM +0100, Stefan Weil wrote:
> 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>
> ---
> tests/linux-test.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
Thanks, applied.
> diff --git a/tests/linux-test.c b/tests/linux-test.c
> index 9986e29..2e4a746 100644
> --- a/tests/linux-test.c
> +++ b/tests/linux-test.c
> @@ -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");
> --
> 1.7.2.3
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-20 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21 21:49 [Qemu-devel] [PATCH 1/3] tests: Fix two memory leaks Stefan Weil
2011-02-20 17:44 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).