[Spice-devel] [PATCH spice-gtk] iopipe: fix leak of streams

Marc-André Lureau marcandre.lureau at redhat.com
Wed May 20 04:08:50 PDT 2015


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



More information about the Spice-devel mailing list