Re: [PATCH 4/4] tests: fix some resource leaks

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

 



On Mon, Apr 10, 2017 at 09:54:00AM +0200, Pavel Hrdina wrote:
Found by running valgrind for these tests.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
tests/commandtest.c    | 3 +++
tests/domaincapstest.c | 2 ++
tests/fchosttest.c     | 2 ++
tests/vircgroupmock.c  | 2 ++
4 files changed, 9 insertions(+)

diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index f871197c25..b76332ce94 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -563,6 +563,8 @@ mymain(void)
    DO_TEST_BHYVE("fbuf", "/usr/sbin/bhyve", &bhyve_caps, VIR_DOMAIN_VIRT_BHYVE);
#endif /* WITH_BHYVE */

+    virObjectUnref(cfg);
+
    return ret;
}


The cfg variable is defined inside an #if WITH_QEMU block, so the unref
should be inside one too.

Jan

Attachment: signature.asc
Description: Digital signature

--
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]
  Powered by Linux