[Spice-devel,spice-gtk,v1] spice-channel: fix small leak

Submitted by Victor Toso on May 2, 2016, 2:02 p.m.

Details

Message ID 1462197752-32666-1-git-send-email-victortoso@redhat.com
State Accepted
Commit 42a5ac811769dc1e19531b769f8df652a67d84df
Headers show
Series "spice-channel: fix small leak" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso May 2, 2016, 2:02 p.m.
182 bytes in 1 blocks are definitely lost in loss record 9,048 of 9,889
at 0x4C2A988: calloc (vg_replace_malloc.c:711)
by 0xB5F4270: g_malloc0 (gmem.c:124)
by 0x7320678: spice_channel_recv_link_hdr (spice-channel.c:1312)
by 0x7320678: spice_channel_coroutine (spice-channel.c:2543)
by 0x7355A4E: coroutine_trampoline (coroutine_ucontext.c:63)
by 0x7355802: continuation_trampoline (continuation.c:55)
---
 src/spice-channel.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/spice-channel.c b/src/spice-channel.c
index 19237b3..f8c8556 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -187,6 +187,8 @@  static void spice_channel_finalize(GObject *gobject)
     if (c->remote_common_caps)
         g_array_free(c->remote_common_caps, TRUE);
 
+    g_clear_pointer(&c->peer_msg, g_free);
+
     /* Chain up to the parent class */
     if (G_OBJECT_CLASS(spice_channel_parent_class)->finalize)
         G_OBJECT_CLASS(spice_channel_parent_class)->finalize(gobject);

Comments

Acked-by: Christophe Fergeau <cfergeau@redhat.com>

On Mon, May 02, 2016 at 04:02:32PM +0200, Victor Toso wrote:
> 182 bytes in 1 blocks are definitely lost in loss record 9,048 of 9,889
> at 0x4C2A988: calloc (vg_replace_malloc.c:711)
> by 0xB5F4270: g_malloc0 (gmem.c:124)
> by 0x7320678: spice_channel_recv_link_hdr (spice-channel.c:1312)
> by 0x7320678: spice_channel_coroutine (spice-channel.c:2543)
> by 0x7355A4E: coroutine_trampoline (coroutine_ucontext.c:63)
> by 0x7355802: continuation_trampoline (continuation.c:55)
> ---
>  src/spice-channel.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/spice-channel.c b/src/spice-channel.c
> index 19237b3..f8c8556 100644
> --- a/src/spice-channel.c
> +++ b/src/spice-channel.c
> @@ -187,6 +187,8 @@ static void spice_channel_finalize(GObject *gobject)
>      if (c->remote_common_caps)
>          g_array_free(c->remote_common_caps, TRUE);
>  
> +    g_clear_pointer(&c->peer_msg, g_free);
> +
>      /* Chain up to the parent class */
>      if (G_OBJECT_CLASS(spice_channel_parent_class)->finalize)
>          G_OBJECT_CLASS(spice_channel_parent_class)->finalize(gobject);
> -- 
> 2.5.5
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
Hi,

On Mon, May 02, 2016 at 04:35:44PM +0200, Christophe Fergeau wrote:
> 
> Acked-by: Christophe Fergeau <cfergeau@redhat.com>

Thanks, pushed.

> 
> On Mon, May 02, 2016 at 04:02:32PM +0200, Victor Toso wrote:
> > 182 bytes in 1 blocks are definitely lost in loss record 9,048 of 9,889
> > at 0x4C2A988: calloc (vg_replace_malloc.c:711)
> > by 0xB5F4270: g_malloc0 (gmem.c:124)
> > by 0x7320678: spice_channel_recv_link_hdr (spice-channel.c:1312)
> > by 0x7320678: spice_channel_coroutine (spice-channel.c:2543)
> > by 0x7355A4E: coroutine_trampoline (coroutine_ucontext.c:63)
> > by 0x7355802: continuation_trampoline (continuation.c:55)
> > ---
> >  src/spice-channel.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/spice-channel.c b/src/spice-channel.c
> > index 19237b3..f8c8556 100644
> > --- a/src/spice-channel.c
> > +++ b/src/spice-channel.c
> > @@ -187,6 +187,8 @@ static void spice_channel_finalize(GObject *gobject)
> >      if (c->remote_common_caps)
> >          g_array_free(c->remote_common_caps, TRUE);
> >  
> > +    g_clear_pointer(&c->peer_msg, g_free);
> > +
> >      /* Chain up to the parent class */
> >      if (G_OBJECT_CLASS(spice_channel_parent_class)->finalize)
> >          G_OBJECT_CLASS(spice_channel_parent_class)->finalize(gobject);
> > -- 
> > 2.5.5
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel



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