]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libvirtd: avoid a NULL dereference on error path
authorJim Meyering <meyering@redhat.com>
Mon, 14 Dec 2009 15:45:11 +0000 (16:45 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 15 Dec 2009 06:53:27 +0000 (07:53 +0100)
* daemon/libvirtd.c (qemudDispatchServer): Since "client" may be
NULL in the "cleanup:" block, free client->rx only when it's not.

daemon/libvirtd.c

index 6b7e33d988ed803dbcdc7132e422564d2744acf3..de6fc273ce000eeb127f39db3123ffcff396e77a 100644 (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;
 }