[PATCH 1/6] tests: fix some memleaks in tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Zhang Bo <oscar.zhangbo@xxxxxxxxxx>
---
 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 6400ea2..f001a39 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 f6a060e..ecefdb9 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 8c52f02..bd457f8 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;
 }
 
-- 
1.7.12.4


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]