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

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



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


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