From patchwork Mon Jan 14 19:55:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7/8] qemu-ga: Plug fd leak on ga_channel_open() error paths Date: Mon, 14 Jan 2013 09:55:11 -0000 From: Michael Roth X-Patchwork-Id: 211899 Message-Id: <1358193312-15960-8-git-send-email-mdroth@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, armbru@redhat.com, lcapitulino@redhat.com From: Markus Armbruster Spotted by Coverity. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Michael Roth Reviewed-by: Luiz Capitulino Signed-off-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 9a5c05d..05e8386 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;