From nobody Mon May 6 11:17:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542078196366147.99513453850295; Mon, 12 Nov 2018 19:03:16 -0800 (PST) Received: from localhost ([::1]:51698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMOym-0000Av-EB for importer@patchew.org; Mon, 12 Nov 2018 22:03:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMOwz-0007lF-8U for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMOwu-0005Gp-DK for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:13 -0500 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:46429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMOwu-0005FU-7J for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:08 -0500 Received: by mail-ot1-x32e.google.com with SMTP id w25so9274008otm.13 for ; Mon, 12 Nov 2018 19:01:08 -0800 (PST) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id o62-v6sm7114744oia.5.2018.11.12.19.01.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 19:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h5GxC/y6e4vT7TcM50SlPKcjrxdQvut4r/IxjfylcFE=; b=jGoXqFVWj3foeUoJyQkR9J6Y5oGx6iXu7aCK4RS+g0JH/wIEW5lM/FmeVUatkCmRdW hnLVZ7IGHOXHZ8lDlpiigkDM9GUSCj9iVJu1uUyPkEFYXq+uhR7OCcRur1b6l2FlCbA1 pmwdC6cHBmgu3nH1jfNOlQWl5Xx2twFbQs8l/AJLIHJm7Hio8O7fy862foxgMx1nZqXD bphJAVjRDdoshG43sJ6JJTcn8Q+dsib0oEpRVckjTWu4hayg3iqdV3DMaNhHEzDrIXsi rsfTqxq+uKoG3K6EGXJbDE0NvYODQ4zsUGbUJWxcK+sb04mit7obvaB61jXah6lu742W 4zVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=h5GxC/y6e4vT7TcM50SlPKcjrxdQvut4r/IxjfylcFE=; b=I5NJ2+ELtklrCvsbk/Ez3ZG5qC12O15JjGGoCR/pNbk1vESCsRBmzdmilY6NhP4JA9 1Lc2zCB3YTX/K8PW3QF/Hgf9JqyhnJn6QuU4+/GHJJTNJ5mEIIdewcqH7zPva7U8VXQR EWbLDZpVmEUQHpvW/VPZPEzXKKDvMPq/ayHzDnaFxk6haG7C5U6FzG3C10zRSAdN+Sqc 4iSvngEAvGBPaL4pxrmai7OR5FKWF3PCnfsd95lMhmT9r8TMynIBap+M/jFS9bLnchpU Xk8DOCeSO79hC0f+1gPzNaQMAiqTudSLKGOvmtrSCrzYaqcKjmVO7eci/ZSAEyb60DG8 It4g== X-Gm-Message-State: AGRZ1gJvrQ64YErYH+OWMbg0cdP5JVD1cImx/evVQTDihtDmebwgdoTv S0KZGpG2WI1PwMHm4t1HOKKJ/TPr X-Google-Smtp-Source: AJdET5d2EB2KuvQqsSS6X7tMLrAlE6dFMgPDU5eYH6Fvjs1W0jMC1O5anZbfq+KxKVgxy9SOwtqmqQ== X-Received: by 2002:a9d:3e4a:: with SMTP id h10mr2239810otg.74.1542078066719; Mon, 12 Nov 2018 19:01:06 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 12 Nov 2018 21:00:46 -0600 Message-Id: <20181113030047.11711-2-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113030047.11711-1-mdroth@linux.vnet.ibm.com> References: <20181113030047.11711-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32e Subject: [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Introduced in commit b1ba8890e63ce9432c41c5c3fc229f54c87c9c99, vol_h handle should be closed, and "out" cleanup should be done after DeviceIoControl() fails. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Michael Roth --- qga/commands-win32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index ef1d7d48d2..62e1b51dfe 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -797,7 +797,7 @@ static GuestDiskAddressList *build_guest_disk_info(char= *guid, Error **errp) 0, extents, size, NULL, NULL)) { error_setg_win32(errp, GetLastError(), "failed to get disk extents"); - return NULL; + goto out; } } else if (last_err =3D=3D ERROR_INVALID_FUNCTION) { /* Possibly CD-ROM or a shared drive. Try to pass the volume */ @@ -855,6 +855,9 @@ static GuestDiskAddressList *build_guest_disk_info(char= *guid, Error **errp) =20 =20 out: + if (vol_h !=3D INVALID_HANDLE_VALUE) { + CloseHandle(vol_h); + } qapi_free_GuestDiskAddress(disk); g_free(extents); g_free(name); --=20 2.17.1 From nobody Mon May 6 11:17:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154207819626123.937821760635302; Mon, 12 Nov 2018 19:03:16 -0800 (PST) Received: from localhost ([::1]:51697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMOyl-000090-WE for importer@patchew.org; Mon, 12 Nov 2018 22:03:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMOwz-0007lG-8W for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMOwx-0005QF-1W for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:13 -0500 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]:37280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMOww-0005L9-IU for qemu-devel@nongnu.org; Mon, 12 Nov 2018 22:01:10 -0500 Received: by mail-oi1-x22c.google.com with SMTP id w66-v6so9068256oiw.4 for ; Mon, 12 Nov 2018 19:01:10 -0800 (PST) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id c30sm7822492otj.62.2018.11.12.19.01.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 19:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1Tvi+vRTFE5I5TmzmKgvowW5cOScHWCsG6sYA/0CPqY=; b=KlmpferHrog/uWDQ10CDTCv5xeffceKTQy0QrJBHL5E2egvZNhNRG2/WGYtHwH8NS2 UZQ7BU60iFCVrunhre5vtQnkKAe5pAGP2kJo+VervbhFf2dNweIwcmnIqQEcnUhVDL69 TLCmu9ykGFg4KdP1QLNeYjT13naOB2vrbXYn5spEWBQBbicEoAvEfqEiVj9R83enLdfR bTNFi00QG5bIzt0f7xJoWPpkXHl9DHf6232EGYYRdhaqjC2t0wFlKsm1bQmuSx6pV0ri cEvMdIa4zfbgtnay7x9DBfQwKAXyGRLqUrGFhCVehT7fXlNsZoLj0D4dMVbAuZTLZW9d s5cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1Tvi+vRTFE5I5TmzmKgvowW5cOScHWCsG6sYA/0CPqY=; b=KZbakMSuaIUGz9LgnHinerxfRGyn7MragKGn3GJrXRcK94+W8d7SVGJCPlhK03fGLr XVylDUEs+WwS2LiNsrNAfKqzX9q2/Wo2EFskU2eGpJ37z0zQ2TXypjDL/OIwLiof1vgx lxnKtuv1tDPBGYYu6ju4+zfP4O28iaQ0B6fq+r4Mf+a345xqtMkuu+b79sibfc3/DAtc J6E2sIm2ivEKU3omCCKtel9tgbjWG/qPM/f7lWaTFYBg7XnSdJeQp/LcveSqHC0AM2Fk LXqslKYTo089Wqz9CBY9e3KQLsEaahXqMd9nSRbh+eOJfq9kB04sQdvqySr9fo+m3s/+ fVrw== X-Gm-Message-State: AGRZ1gLpgnLIKSwrnD+/TX99rXZA3j0j05ivT7UEONp/f5QujlRghcVZ M0O0ENtirnG6wlbO80fb4WP0dAkr X-Google-Smtp-Source: AJdET5cwRk6rikG4wlBnswC0NAPSnO+a1hjxhI6yIaw/1Q9ktFQt6Ybn/FmePYvy01T4AhuwhiBAFg== X-Received: by 2002:aca:f154:: with SMTP id p81-v6mr2092892oih.348.1542078069184; Mon, 12 Nov 2018 19:01:09 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 12 Nov 2018 21:00:47 -0600 Message-Id: <20181113030047.11711-3-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113030047.11711-1-mdroth@linux.vnet.ibm.com> References: <20181113030047.11711-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22c Subject: [Qemu-devel] [PULL for-3.1 2/2] qga: Add multiple include guard to guest-agent-core.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Peter Maydell The guest-agent-core.h header was missing the usual guards against multiple inclusion; add them. (Spotted by lgtm.com's static analyzer.) Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Michael Roth --- qga/guest-agent-core.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h index 6f4d214cb9..60eae16f27 100644 --- a/qga/guest-agent-core.h +++ b/qga/guest-agent-core.h @@ -10,6 +10,9 @@ * This work is licensed under the terms of the GNU GPL, version 2 or late= r. * See the COPYING file in the top-level directory. */ +#ifndef GUEST_AGENT_CORE_H +#define GUEST_AGENT_CORE_H + #include "qapi/qmp/dispatch.h" #include "qemu-common.h" #include "qga-qapi-types.h" @@ -46,3 +49,5 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp= ); #ifndef _WIN32 void reopen_fd_to_null(int fd); #endif + +#endif /* GUEST_AGENT_CORE_H */ --=20 2.17.1