]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
tests: fix some memleaks in tests
authorZhang Bo <oscar.zhangbo@huawei.com>
Mon, 27 Apr 2015 06:41:40 +0000 (14:41 +0800)
committerJán Tomko <jtomko@redhat.com>
Mon, 27 Apr 2015 08:04:38 +0000 (10:04 +0200)
Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
tests/commandtest.c
tests/domaincapstest.c
tests/qemucommandutiltest.c

index 6400ea283f8a16f8efd1c03c3699494aff07835d..f001a39718e2871c547eb2fe841b3b139fd72fe1 100644 (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] */
index f6a060ec646eac5cc57e726a7e7139a168f1b15b..ecefdb9bd277146070e3fab7fb1302d43c2d95a7 100644 (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",
index 8c52f02d18ac85cfb650ee62090dc77ae4ab301e..bd457f82aa28d827062b1c3411f8623ceb4b400b 100644 (file)
@@ -66,6 +66,7 @@ testQemuCommandBuildObjectFromJSON(const void *opaque)
  cleanup:
     virJSONValueFree(val);
     VIR_FREE(result);
+    VIR_FREE(expect);
     return ret;
 }