From patchwork Fri Jan 11 10:25:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5/6] qemu-ga: Plug fd leak on ga_channel_open() error paths Date: Fri, 11 Jan 2013 00:25:01 -0000 From: Markus Armbruster X-Patchwork-Id: 211290 Message-Id: <1357899902-5316-6-git-send-email-armbru@redhat.com> To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com Spotted by Coverity. Signed-off-by: Markus Armbruster Reviewed-by: Michael Roth --- qga/channel-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qga/channel-posix.c b/qga/channel-posix.c index 5579185..b530808 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -153,6 +153,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;