[libvirt-designer 2/2] Fix gvir_designer_domain_get_guest_full() leak

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

 



One GVirConfigCapabilitiesGuestArch instance was created for each loop
iteration, but it was never unref'ed, causing a memory leak.
---
 libvirt-designer/libvirt-designer-domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c
index 6629fb5..cefefea 100644
--- a/libvirt-designer/libvirt-designer-domain.c
+++ b/libvirt-designer/libvirt-designer-domain.c
@@ -999,10 +999,12 @@ gvir_designer_domain_get_guest_full(GVirDesignerDomain *design,
 
         if (g_str_equal(guestarch, wantarch) &&
             guestos == ostype) {
+            g_object_unref(G_OBJECT(arch));
             ret = g_object_ref(guest);
             goto cleanup;
         }
 
+        g_object_unref(G_OBJECT(arch));
         tmp = tmp->next;
     }
 
-- 
2.1.0

--
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]