提交 6e07f72e 编写于 作者: E Eric Blake 提交者: Daniel Veillard

rpc: avoid memory leak on error

Detected by Coverity.  The leak is on an error path, but I'm not
sure whether that path is likely to be triggered in practice.

* src/rpc/virnetserverservice.c (virNetServerServiceAccept): Plug leak.
上级 2aa83b43
......@@ -82,7 +82,12 @@ cleanup:
return;
error:
virNetSocketFree(clientsock);
if (client) {
virNetServerClientClose(client);
virNetServerClientFree(client);
} else {
virNetSocketFree(clientsock);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册