qemu-ga: Plug fd leak on ga_channel_open() error paths

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>
This commit is contained in:
Markus Armbruster 2013-01-11 11:25:01 +01:00 committed by Michael Roth
parent 32c16620dd
commit d4f4a3efdf

View File

@ -154,6 +154,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod
ret = ga_channel_client_add(c, fd);
if (ret) {
g_critical("error adding channel to main loop");
close(fd);
return false;
}
break;