[libvirt-glib] Don't leak virStreams, take the reference

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

 



Without this change, after virStreamNew() and
g_value_dup_boxed() it will have refcnt = 2
and will leak when GVirStream is destroyed.
---
 libvirt-gobject/libvirt-gobject-stream.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libvirt-gobject/libvirt-gobject-stream.c b/libvirt-gobject/libvirt-gobject-stream.c
index 88e3a40..4aeb182 100644
--- a/libvirt-gobject/libvirt-gobject-stream.c
+++ b/libvirt-gobject/libvirt-gobject-stream.c
@@ -160,7 +160,7 @@ static void gvir_stream_set_property(GObject *object,
     case PROP_HANDLE:
         if (priv->handle)
             virStreamFree(priv->handle);
-        priv->handle = g_value_dup_boxed(value);
+        priv->handle = g_value_get_boxed(value);
         break;
 
     default:
-- 
1.7.6.2

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