g_simple_io_stream_new() do not steal references from us, unref the
streams to avoid the leaks.

Leak found by Victor Toso.
---
 gtk/giopipe.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gtk/giopipe.c b/gtk/giopipe.c
index 32fa4fa..56389da 100644
--- a/gtk/giopipe.c
+++ b/gtk/giopipe.c
@@ -467,4 +467,9 @@ spice_make_pipe(GIOStream **p1, GIOStream **p2)
 
     *p1 = g_simple_io_stream_new(in1, out1);
     *p2 = g_simple_io_stream_new(in2, out2);
+
+    g_object_unref(in1);
+    g_object_unref(in2);
+    g_object_unref(out1);
+    g_object_unref(out2);
 }
-- 
2.1.0

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to