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

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

 



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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]