From patchwork Mon Jan 14 19:55:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 211899 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 853C72C009D for ; Tue, 15 Jan 2013 07:55:34 +1100 (EST) Received: from localhost ([::1]:56603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuqDR-00034W-SO for incoming@patchwork.ozlabs.org; Mon, 14 Jan 2013 15:01:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuqCp-0001Wf-Kl for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuqCo-0008R4-BA for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:27 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:42965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuqCo-0008Qq-6W for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:26 -0500 Received: by mail-ie0-f175.google.com with SMTP id qd14so5747853ieb.34 for ; Mon, 14 Jan 2013 12:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=sZbiRCf1PoVudiBzVr5GV0Yl3lgWyNcY4D9F2c1ZrDI=; b=JX6mpcXBgpDHka1loS0cL4XUt6o5WiBcg1yXQALwHK3DlCMKlz7d7LCf2Rqz+O973M TQaLyB7kYDmWX2AY8eIRmBMVPOjVhyI1FGF3U7AKAPb37ijuDQUWivlF5F23VpK7fNbo M34N6xDiebX37SN+rp5vWQJlV+yMLFY4Ukl1Fb3/0tqu4KrFRqUFhqbUC2LyzO6r7Xf3 ztD758y8VxrTnKdY5AKXuWXocUmqwxad8DG2vcx/V7nkKBsYNn6+RCkPj3eLGqKlJsnL jSheYiJzmGDp7LFkc6jp9Ld/9P+yuh7JMygAPlQQnolv7RD3FBdxjknrBmm6z+5+q/9n O7eA== X-Received: by 10.50.17.230 with SMTP id r6mr886272igd.1.1358193625487; Mon, 14 Jan 2013 12:00:25 -0800 (PST) Received: from localhost ([32.97.110.59]) by mx.google.com with ESMTPS id k5sm129948igq.9.2013.01.14.12.00.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Jan 2013 12:00:25 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2013 13:55:11 -0600 Message-Id: <1358193312-15960-8-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358193312-15960-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1358193312-15960-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.223.175 Cc: aliguori@us.ibm.com, armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH 7/8] qemu-ga: Plug fd leak on ga_channel_open() error paths X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;