From 083ac198bc437e6e96fda0cff48dd0441b7eb5d7 Mon Sep 17 00:00:00 2001 From: Zhang Bo Date: Mon, 27 Apr 2015 14:41:40 +0800 Subject: [PATCH] tests: fix some memleaks in tests Signed-off-by: Zhang Bo --- tests/commandtest.c | 1 + tests/domaincapstest.c | 1 + tests/qemucommandutiltest.c | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/commandtest.c b/tests/commandtest.c index 6400ea283f..f001a39718 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1081,6 +1081,7 @@ static int test24(const void *unused ATTRIBUTE_UNUSED) if (pidfile) unlink(pidfile); VIR_FREE(pidfile); + VIR_FREE(prefix); virCommandFree(cmd); VIR_FORCE_CLOSE(newfd1); /* coverity[double_close] */ diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index f6a060ec64..ecefdb9bd2 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -242,6 +242,7 @@ mymain(void) ret = -1; \ } else if (virtTestRun(Filename, test_virDomainCapsFormat, &data) < 0) \ ret = -1; \ + virObjectUnref(qemuCaps); \ } while (0) DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1", "/usr/bin/qemu-system-x86_64", diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c index 8c52f02d18..bd457f82aa 100644 --- a/tests/qemucommandutiltest.c +++ b/tests/qemucommandutiltest.c @@ -66,6 +66,7 @@ testQemuCommandBuildObjectFromJSON(const void *opaque) cleanup: virJSONValueFree(val); VIR_FREE(result); + VIR_FREE(expect); return ret; }