Re: [Spice-devel] [spice-server] channel: Fix leak in red_channel_remove_client

2017-09-18 Thread Frediano Ziglio
> 
> 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 

Acked-by: Frediano Ziglio 

Looks like Valgrind finds leaks better than address sanitizer.

Frediano

> ---
>  server/red-channel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index b4a92340f..b5094829e 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???
>  }
>  
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [spice-server] channel: Fix leak in red_channel_remove_client

2017-09-18 Thread Christophe Fergeau
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 
---
 server/red-channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index b4a92340f..b5094829e 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???
 }
 
-- 
2.13.5

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