]> git.proxmox.com Git - qemu.git/commitdiff
qemu-ga: Plug fd leak on ga_channel_listen_accept() error path
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Jan 2013 10:25:00 +0000 (11:25 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 14 Jan 2013 18:07:54 +0000 (12:07 -0600)
Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/channel-posix.c

index ca9e4aaaf99de08221449014573196d1cceb7cca..9a5c05d666b4fc8490c517d68b7d38a40b939e2e 100644 (file)
@@ -46,6 +46,7 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel,
     ret = ga_channel_client_add(c, client_fd);
     if (ret) {
         g_warning("error setting up connection");
+        close(client_fd);
         goto out;
     }
     accepted = true;