[Spice-commits] server/red-channel.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Sep 18 15:32:41 UTC 2017


 server/red-channel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f49f04f2bee50d44ba727e24aed59a4415607e48
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Sep 18 17:25:57 2017 +0200

    channel: Fix leak in red_channel_remove_client
    
    It was using g_list_remove_link() to remove an element from the
    RedChannel::clients list while it really meant to be using
    g_list_delete_link() which frees the memory associated with the link.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/red-channel.c b/server/red-channel.c
index b4a92340..b5094829 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -477,7 +477,7 @@ void red_channel_remove_client(RedChannel *channel, RedChannelClient *rcc)
     link = g_list_find(channel->priv->clients, rcc);
     spice_return_if_fail(link != NULL);
 
-    channel->priv->clients = g_list_remove_link(channel->priv->clients, link);
+    channel->priv->clients = g_list_delete_link(channel->priv->clients, link);
     // TODO: should we set rcc->channel to NULL???
 }
 


More information about the Spice-commits mailing list