mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
Really don't crash if a connection closes early
https://bugzilla.redhat.com/show_bug.cgi?id=1047577 When writing commit173c291
, I missed the fact virNetServerClientClose unlocks the client object before actually clearing client->sock and thus it is possible to hit a window when client->keepalive is NULL while client->sock is not NULL. I was thinking client->sock == NULL was a better check for a closed connection but apparently we have to go with client->keepalive == NULL to actually fix the crash. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> (cherry picked from commit066c8ef6c1
)
This commit is contained in:
parent
ed327dfcf4
commit
2842b103b1
@ -1540,7 +1540,7 @@ virNetServerClientStartKeepAlive(virNetServerClientPtr client)
|
|||||||
/* The connection might have been closed before we got here and thus the
|
/* The connection might have been closed before we got here and thus the
|
||||||
* keepalive object could have been removed too.
|
* keepalive object could have been removed too.
|
||||||
*/
|
*/
|
||||||
if (!client->sock) {
|
if (!client->keepalive) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("connection not open"));
|
_("connection not open"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user