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

View File

@ -644,7 +644,8 @@ virNetClientMarkClose(virNetClientPtr client,
int reason) int reason)
{ {
VIR_DEBUG("client=%p, reason=%d", client, reason); VIR_DEBUG("client=%p, reason=%d", client, reason);
virNetSocketRemoveIOCallback(client->sock); if (client->sock)
virNetSocketRemoveIOCallback(client->sock);
client->wantClose = true; client->wantClose = true;
client->closeReason = reason; client->closeReason = reason;
} }