From nobody Mon Feb 9 15:40:31 2026 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499868000107244.59178306635272; Wed, 12 Jul 2017 07:00:00 -0700 (PDT) Received: from localhost ([::1]:53318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVIBK-00039V-Ty for importer@patchew.org; Wed, 12 Jul 2017 09:59:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVI85-0008NV-44 for qemu-devel@nongnu.org; Wed, 12 Jul 2017 09:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVI81-0000qZ-4u for qemu-devel@nongnu.org; Wed, 12 Jul 2017 09:56:37 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:54545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVI80-0000q6-TV; Wed, 12 Jul 2017 09:56:33 -0400 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 910BF40F6A; Wed, 12 Jul 2017 16:56:31 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 8D90BAC8; Wed, 12 Jul 2017 16:38:14 +0300 (MSK) Received: (nullmailer pid 29049 invoked by uid 1000); Wed, 12 Jul 2017 13:38:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Wed, 12 Jul 2017 16:38:05 +0300 Message-Id: <9bd8e9330ade42878b19a5172131087220d590d5.1499866676.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 09/13] qga-win32: Fix memory leak of device information set 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: qemu-trivial@nongnu.org, Li Ping , Michael Tokarev Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Li Ping The caller of SetupDiGetClassDevs must delete the returned device informati= on set when it is no longer needed by calling SetupDiDestroyDeviceInfoList. Signed-off-by: Li Ping Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Michael Tokarev --- 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 439d229225..6f1645747b 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -512,7 +512,7 @@ static GuestPCIAddress *get_pci_info(char *guid, Error = **errp) } else { error_setg_win32(errp, GetLastError(), "failed to get device name"); - goto out; + goto free_dev_info; } } =20 @@ -560,6 +560,9 @@ static GuestPCIAddress *get_pci_info(char *guid, Error = **errp) pci->bus =3D bus; break; } + +free_dev_info: + SetupDiDestroyDeviceInfoList(dev_info); out: g_free(buffer); g_free(name); --=20 2.11.0