From nobody Mon Feb 9 11:46:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1641822757; cv=none; d=zohomail.com; s=zohoarc; b=b3EhORIIA8HeBtXA6wS5XWf6NFL+I8PAG9bcG9Lri9jDrK7kXLcFPweWFQKxgvBwSdipxTLL1s+ZATOrxpOa3ikgZXk8wRXPvQu4+dchU8uJYbqWthULs6K8m7Ul3fRnPgOtm5VjUHSZ5vD2ZyV5DdsiS3xNeUKp0FX4vYdAaHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641822757; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=INkPE+Nwn2YIyU4WMhuqG3ay4pwb6QMnPEdGJng4ARs=; b=T3BzyagDHke8Aoz6e6PMXKjSub2VThu++pHyNZBXjB9+fMVWDRxLKUUpX5b8EHWtSJ3iP6W0Q3aspDKE1+VTvn8U3QSeRLHgrl7iFfBkijhvvjqorkx8Pjzbb4z/BoCsBPS26U6FRIub72ezM8plwgnNUBMJN+EIoU+MEYsNCFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641822757923199.2634184442129; Mon, 10 Jan 2022 05:52:37 -0800 (PST) Received: from localhost ([::1]:56238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6v6C-0000q9-Qk for importer@patchew.org; Mon, 10 Jan 2022 08:52:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6v0m-0002Ao-D1 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 08:47:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6v0k-00071a-0c for qemu-devel@nongnu.org; Mon, 10 Jan 2022 08:47:00 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-G48DzG6-Ncu6l0mFUu-DUw-1; Mon, 10 Jan 2022 08:46:56 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9FE6C81CCBD; Mon, 10 Jan 2022 13:46:55 +0000 (UTC) Received: from kostyanf14nb.Dlink (unknown [10.40.193.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9D427BB5B; Mon, 10 Jan 2022 13:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641822417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=INkPE+Nwn2YIyU4WMhuqG3ay4pwb6QMnPEdGJng4ARs=; b=NIEc3FUmMT8pIthTxlfTDc0+3/XKMwLOdSD/SXWs8hmmhoq+SWgNR6sBTw+lJX3z+IhAwB BjLOTSl7gp+nRO0GoMcTGImyua/o1dTZ6knUO5Dc1Xp185PMyJ4i5mRtEVNNeCi8pwJj9N 8F36MYhH4Do8r7tJOQTG4O67i7iOKzg= X-MC-Unique: G48DzG6-Ncu6l0mFUu-DUw-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 6/9] gqa-win: get_pci_info: Add g_autofree for few variables Date: Mon, 10 Jan 2022 15:46:41 +0200 Message-Id: <20220110134644.107375-7-kkostiuk@redhat.com> In-Reply-To: <20220110134644.107375-1-kkostiuk@redhat.com> References: <20220110134644.107375-1-kkostiuk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kkostiuk@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641822759316100001 From: Kostiantyn Kostiuk Signed-off-by: Kostiantyn Kostiuk Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Kostiantyn Kostiuk --- qga/commands-win32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 8588fa8633..3092566313 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -626,9 +626,9 @@ static GuestPCIAddress *get_pci_info(int number, Error = **errp) dev_info_data.cbSize =3D sizeof(SP_DEVINFO_DATA); dev_iface_data.cbSize =3D sizeof(SP_DEVICE_INTERFACE_DATA); for (i =3D 0; SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++)= { - PSP_DEVICE_INTERFACE_DETAIL_DATA pdev_iface_detail_data =3D NULL; + g_autofree PSP_DEVICE_INTERFACE_DETAIL_DATA pdev_iface_detail_data= =3D NULL; STORAGE_DEVICE_NUMBER sdn; - char *parent_dev_id =3D NULL; + g_autofree char *parent_dev_id =3D NULL; SP_DEVINFO_DATA parent_dev_info_data; DWORD size =3D 0; =20 @@ -654,7 +654,6 @@ static GuestPCIAddress *get_pci_info(int number, Error = **errp) dev_file =3D CreateFile(pdev_iface_detail_data->DevicePath, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - g_free(pdev_iface_detail_data); =20 if (!DeviceIoControl(dev_file, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &sdn, sizeof(sdn), &size, NULL))= { @@ -741,7 +740,6 @@ static GuestPCIAddress *get_pci_info(int number, Error = **errp) parent_dev_info =3D SetupDiGetClassDevs(&GUID_DEVINTERFACE_STORAGEPORT, parent_dev= _id, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFAC= E); - g_free(parent_dev_id); =20 if (parent_dev_info =3D=3D INVALID_HANDLE_VALUE) { error_setg_win32(errp, GetLastError(), --=20 2.25.1