On Wed, Nov 30, 2016 at 12:34:52PM +0000, Frediano Ziglio wrote:
> Avoid having dandling pointer to a client.

'dangling'

> 
> Signed-off-by: Frediano Ziglio <fzig...@redhat.com>
> ---
>  server/sound.c |  9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/server/sound.c b/server/sound.c
> index a5b960b..00eab67 100644
> --- a/server/sound.c
> +++ b/server/sound.c
> @@ -773,6 +773,14 @@ static int snd_channel_config_socket(RedChannelClient 
> *rcc)
>      return TRUE;
>  }
>  
> +static void snd_channel_on_disconnect(RedChannelClient *rcc)
> +{
> +    SndChannel *channel = SND_CHANNEL(red_channel_client_get_channel(rcc));
> +    if (channel->connection && rcc == 
> RED_CHANNEL_CLIENT(channel->connection)) {

Is it expected that channel->connection will sometimes not be equal to rcc 
here? Or
should it issue some kind of runtime warning if this happens?

> +        channel->connection = NULL;

Christophe

Attachment: signature.asc
Description: PGP signature

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

Reply via email to