From: Jim Meyering Date: Mon, 14 Dec 2009 15:45:11 +0000 (+0100) Subject: libvirtd: avoid a NULL dereference on error path X-Git-Tag: v0.7.5~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63a499d3f33e44e27ddd186fa734ea60d7a519fb;p=thirdparty%2Flibvirt.git 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. --- diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 6b7e33d988..de6fc273ce 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -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; }