[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] rpc: fix segmentation fault caused by null client-sock



On 08/27/2012 11:09 AM, Guannan Ren wrote:
> BZ:https://bugzilla.redhat.com/show_bug.cgi?id=851423
> The client-sock could have been set to NULL by eventloop thread
> after async event fired.
> ---
>  src/rpc/virnetclient.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
> index 4ecc703..43a9814 100644
> --- a/src/rpc/virnetclient.c
> +++ b/src/rpc/virnetclient.c
> @@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
>                        int reason)
>  {
>      VIR_DEBUG("client=%p, reason=%d", client, reason);
> -    virNetSocketRemoveIOCallback(client->sock);
> +    if (client->sock)
> +        virNetSocketRemoveIOCallback(client->sock);
>      client->wantClose = true;
>      client->closeReason = reason;
>  }
> 

ACK,

Martin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]