summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-11 11:25:01 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-01-14 12:07:59 -0600
commitd4f4a3efdf0a71621ae5351176f5f15b522d0026 (patch)
tree38579b1bd2aaede9f6bbbf76b07c8ffff57657c8
parent32c16620dda8ba16f6d6bcd20efefdec8975af77 (diff)
downloadqemu-d4f4a3efdf0a71621ae5351176f5f15b522d0026.zip
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>
-rw-r--r--qga/channel-posix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 9a5c05d666..05e83860ca 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -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;