mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
340196c46f
commit
2b8624dd33
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue