[Spice-devel] [PATCH 01/26] server/red_channel: protect red_channel_destroy from NULL peer

Marc-André Lureau marcandre.lureau at gmail.com
Mon Feb 14 17:44:45 PST 2011


ack to merge with patch 23/23 of previous patch series.

On Fri, Feb 11, 2011 at 6:48 PM, Alon Levy <alevy at redhat.com> wrote:
> happens in red_worker, since the destroy path there is different due
> to (unneccessary?) ref counting on the channel.
> ---
>  server/red_channel.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/server/red_channel.c b/server/red_channel.c
> index dfba8b4..fc18b09 100644
> --- a/server/red_channel.c
> +++ b/server/red_channel.c
> @@ -427,8 +427,10 @@ void red_channel_destroy(RedChannel *channel)
>         return;
>     }
>     red_channel_pipe_clear(channel);
> -    channel->core->watch_remove(channel->peer->watch);
> -    channel->peer->cb_free(channel->peer);
> +    if (channel->peer) {
> +        channel->core->watch_remove(channel->peer->watch);
> +        channel->peer->cb_free(channel->peer);
> +    }
>     spice_marshaller_destroy(channel->send_data.marshaller);
>     free(channel);
>  }
> --
> 1.7.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list