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@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Christophe Fergeau 2017-09-18 17:25:57 +02:00 committed by Frediano Ziglio
parent 328a4a9b28
commit f49f04f2be

View File

@ -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???
}