From d4f4a3efdf0a71621ae5351176f5f15b522d0026 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 11 Jan 2013 11:25:01 +0100 Subject: qemu-ga: Plug fd leak on ga_channel_open() error paths 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 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; -- cgit v1.2.3