libvirtd: avoid a NULL dereference on error path

* daemon/libvirtd.c (qemudDispatchServer): Since "client" may be
NULL in the "cleanup:" block, free client->rx only when it's not.
This commit is contained in:
Jim Meyering 2009-12-14 16:45:11 +01:00
parent 52a18abd94
commit 63a499d3f3

View File

@ -1422,7 +1422,8 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
if (client &&
client->tlssession) gnutls_deinit (client->tlssession);
close (fd);
VIR_FREE(client->rx);
if (client)
VIR_FREE(client->rx);
VIR_FREE(client);
return -1;
}