rpc: fix segmentation fault caused by null client-sock

The client-sock could have been set to NULL by eventloop thread
after async event fired.
This commit is contained in:
Guannan Ren 2012-08-27 16:59:25 +08:00
parent 340196c46f
commit 2b8624dd33
1 changed files with 2 additions and 1 deletions

View File

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