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

Christophe Fergeau cfergeau at redhat.com
Wed May 20 09:18:49 PDT 2015


On Wed, May 20, 2015 at 01:08:50PM +0200, Marc-André Lureau wrote:
> g_simple_io_stream_new() do not steal references from us, unref the
> streams to avoid the leaks.
> 
> Leak found by Victor Toso.

ACK, I'd add the valgrind trace which was in the patch he proposed for
the same issue.

Christophe

> ---
>  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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150520/8d3bb6a9/attachment.sig>


More information about the Spice-devel mailing list