提交 2b8624dd 编写于 作者: G Guannan Ren

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.
上级 340196c4
...@@ -644,6 +644,7 @@ virNetClientMarkClose(virNetClientPtr client, ...@@ -644,6 +644,7 @@ virNetClientMarkClose(virNetClientPtr client,
int reason) int reason)
{ {
VIR_DEBUG("client=%p, reason=%d", client, reason); VIR_DEBUG("client=%p, reason=%d", client, reason);
if (client->sock)
virNetSocketRemoveIOCallback(client->sock); virNetSocketRemoveIOCallback(client->sock);
client->wantClose = true; client->wantClose = true;
client->closeReason = reason; client->closeReason = reason;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册