From: Zhang Bo Date: Mon, 27 Apr 2015 06:41:40 +0000 (+0800) Subject: tests: fix some memleaks in tests X-Git-Tag: v1.2.15-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=083ac198bc437e6e96fda0cff48dd0441b7eb5d7;p=thirdparty%2Flibvirt.git tests: fix some memleaks in tests Signed-off-by: Zhang Bo --- 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; }