From nobody Mon Feb 9 09:09:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613167693; cv=none; d=zohomail.com; s=zohoarc; b=IgGWzYlOQ/2N6LqG7gP2+9Zb+5faSNP+bP9E1dEK4EOVK4Bc1ltNk9pkxYgSy+OZm6Mmq85WvGlOkzQA5uUBECYUVrt5lu1InrP4wyMhmQ9eMPJORPfrz/8Y+A9pVUDiYjpMBTEODfcCKNOx+VcwIa0L9sVa9NE72YwYHTpty88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613167693; 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=FFWVIOFQg1+WhI//ANP1R+NUojp+ErZKhyg4KlIA7mc=; b=YYdfcARGZQ6gFKg7jByw2lm6yufqLx8/ASJVJ9AaihrSxcPFdhMAz0ZPiwAJUDU2KMUpMWppDQHkjqD9XxuUKP3AeeSTo4vQNBDGSA1YEk5aNQUB+Q6ckGMM1ZkuY/mGATaFI61o3etG1+ZUYXmrDStjgk/zXGtpPy1K7+w3PGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613167693201820.4126094255387; Fri, 12 Feb 2021 14:08:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-xD14SbF1PhyrYmJmNdBDVA-1; Fri, 12 Feb 2021 17:07:46 -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 7ED7B107ACC7; Fri, 12 Feb 2021 22:07:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A66A5C23D; Fri, 12 Feb 2021 22:07:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 22AA218095CD; Fri, 12 Feb 2021 22:07:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11CM7OGn006170 for ; Fri, 12 Feb 2021 17:07:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3A3AD1002388; Fri, 12 Feb 2021 22:07:24 +0000 (UTC) Received: from vhost2.router.laine.org (ovpn-112-48.phx2.redhat.com [10.3.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0238C1001E73 for ; Fri, 12 Feb 2021 22:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613167685; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FFWVIOFQg1+WhI//ANP1R+NUojp+ErZKhyg4KlIA7mc=; b=famO9Hlz3Cy4knf+/XF9plRUMLzYN7ST9cBdk8KbE46tyOKcqGH+CbRXXZfwVvfxZxrGnd n8GAmaZsOQjVMYB93NIWS/abAB9b891ziG7S2eQZI/IlM8qYM1+UzBSbHJYA/RRdeCFoLA SjXwqn4tHg16bl5hr9Yh4D738dS3sgo= X-MC-Unique: xD14SbF1PhyrYmJmNdBDVA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 7/9] esx: switch VIR_FREE->g_free when the pointer will immediately go out of scope Date: Fri, 12 Feb 2021 17:07:15 -0500 Message-Id: <20210212220717.910294-8-laine@redhat.com> In-Reply-To: <20210212220717.910294-1-laine@redhat.com> References: <20210212220717.910294-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Or when it will be immediately have a new value assigned to it. Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 4 ++-- src/esx/esx_network_driver.c | 2 +- src/esx/esx_storage_backend_iscsi.c | 4 ++-- src/esx/esx_storage_backend_vmfs.c | 4 ++-- src/esx/esx_util.c | 4 ++-- src/esx/esx_vi.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 2d010096a5..fe98f90ea9 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2619,7 +2619,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int= flags) cleanup: esxVI_String_Free(&propertyNameList); esxVI_ObjectContent_Free(&virtualMachine); - VIR_FREE(data.datastorePathWithoutFileName); + g_free(data.datastorePathWithoutFileName); virDomainDefFree(def); =20 return xml; @@ -4946,7 +4946,7 @@ esxConnectListAllDomains(virConnectPtr conn, for (id =3D 0; id < count; id++) virObjectUnref(doms[id]); =20 - VIR_FREE(doms); + g_free(doms); } =20 esxVI_AutoStartDefaults_Free(&autoStartDefaults); diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c index 15fc7931c0..b489f4de8a 100644 --- a/src/esx/esx_network_driver.c +++ b/src/esx/esx_network_driver.c @@ -913,7 +913,7 @@ esxConnectListAllNetworks(virConnectPtr conn, if (ret < 0) { if (nets && *nets) { for (i =3D 0; i < count; ++i) - VIR_FREE((*nets)[i]); + g_free((*nets)[i]); VIR_FREE(*nets); } } diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_back= end_iscsi.c index 41bb9f6094..d89b5a4ba8 100644 --- a/src/esx/esx_storage_backend_iscsi.c +++ b/src/esx/esx_storage_backend_iscsi.c @@ -348,7 +348,7 @@ esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsign= ed int flags) xml =3D virStoragePoolDefFormat(&def); =20 cleanup: - VIR_FREE(def.source.hosts); + g_free(def.source.hosts); esxVI_HostInternetScsiHba_Free(&hostInternetScsiHba); =20 return xml; @@ -727,7 +727,7 @@ esxStorageVolGetXMLDesc(virStorageVolPtr volume, =20 cleanup: esxVI_ScsiLun_Free(&scsiLunList); - VIR_FREE(def.key); + g_free(def.key); =20 return xml; } diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backe= nd_vmfs.c index 225b2a4751..95505d6796 100644 --- a/src/esx/esx_storage_backend_vmfs.c +++ b/src/esx/esx_storage_backend_vmfs.c @@ -544,7 +544,7 @@ esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsign= ed int flags) xml =3D virStoragePoolDefFormat(&def); =20 cleanup: - VIR_FREE(def.source.hosts); + g_free(def.source.hosts); esxVI_String_Free(&propertyNameList); esxVI_ObjectContent_Free(&datastore); esxVI_DatastoreHostMount_Free(&hostMount); @@ -1390,7 +1390,7 @@ esxStorageVolGetXMLDesc(virStorageVolPtr volume, =20 cleanup: esxVI_FileInfo_Free(&fileInfo); - VIR_FREE(def.key); + g_free(def.key); =20 return xml; } diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index e9b74f386f..f1e8339fe0 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -55,7 +55,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr= uri) virURIParamPtr queryParam =3D &uri->params[i]; =20 if (STRCASEEQ(queryParam->name, "transport")) { - VIR_FREE((*parsedUri)->transport); + g_free((*parsedUri)->transport); =20 (*parsedUri)->transport =3D g_strdup(queryParam->value); =20 @@ -68,7 +68,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr= uri) goto cleanup; } } else if (STRCASEEQ(queryParam->name, "vcenter")) { - VIR_FREE((*parsedUri)->vCenter); + g_free((*parsedUri)->vCenter); =20 (*parsedUri)->vCenter =3D g_strdup(queryParam->value); } else if (STRCASEEQ(queryParam->name, "no_verify")) { diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 987259be4b..2a999f1cc1 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -4280,7 +4280,7 @@ esxVI_WaitForTaskCompletion(esxVI_Context *ctx, if (esxVI_WaitForUpdates(ctx, version, &updateSet) < 0) goto cleanup; =20 - VIR_FREE(version); + g_free(version); version =3D g_strdup(updateSet->version); =20 if (!updateSet->filterSet) @@ -4355,7 +4355,7 @@ esxVI_WaitForTaskCompletion(esxVI_Context *ctx, =20 esxVI_PropertyFilterSpec_Free(&propertyFilterSpec); esxVI_ManagedObjectReference_Free(&propertyFilter); - VIR_FREE(version); + g_free(version); esxVI_UpdateSet_Free(&updateSet); esxVI_TaskInfo_Free(&taskInfo); =20 --=20 2.29.2