tests: fix some memleaks in tests

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
Zhang Bo 2015-04-27 14:41:40 +08:00 committed by Ján Tomko
parent 659dbba37e
commit 083ac198bc
3 changed files with 3 additions and 0 deletions

View File

@ -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] */

View File

@ -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",

View File

@ -66,6 +66,7 @@ testQemuCommandBuildObjectFromJSON(const void *opaque)
cleanup:
virJSONValueFree(val);
VIR_FREE(result);
VIR_FREE(expect);
return ret;
}