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:
parent
32c16620dd
commit
d4f4a3efdf
@ -154,6 +154,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod
|
|||||||
ret = ga_channel_client_add(c, fd);
|
ret = ga_channel_client_add(c, fd);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
g_critical("error adding channel to main loop");
|
g_critical("error adding channel to main loop");
|
||||||
|
close(fd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user