Really don't crash if a connection closes early
authorJiri Denemark <jdenemar@redhat.com>
Mon, 13 Jan 2014 14:46:24 +0000 (15:46 +0100)
committerEric Blake <eblake@redhat.com>
Wed, 15 Jan 2014 13:58:05 +0000 (06:58 -0700)
commit08672cff7b2fe789bea4ebb1fed883c93b98ea0d
tree38ea8bed806f289b63b995035f30f7fe51be6a0e
parentac4be802610e55ef4a17fd0e40cadc207ebbaa12
Really don't crash if a connection closes early

https://bugzilla.redhat.com/show_bug.cgi?id=1047577

When writing commit 173c291, 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 commit 066c8ef6c18bc1faf8b3e10787b39796a7a06cc0)
src/rpc/virnetserverclient.c