From nobody Mon Feb 9 12:25:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1613167750; cv=none; d=zohomail.com; s=zohoarc; b=O5SdKl5OVTGQXtUD7qnwUU0HgKqb27yCJjZ7xNyXbHdnO+/LvTvEbWZEMj/tYAa/JHayzorYKJloKKIqPxzdX0Eii1IeUZNKIuxnRMVB+4u70dp6vodH3jAQclW4lk5wsBgpI52T7mf4u3S5QqFfPAGp/4iiEGKqhrjfj+N2/GI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613167750; 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=6GvLqd3MLiwMgIh8Wp0ImjqZs2uq4SUN6X4lDfuaPLE=; b=W5a83sqVl5Wgb7G4xs9Ti5pUWx2hkPShzmyQgmVMhQWEteiMy37Gyz1rYvFcjS5U0b8jJxYCbu9Ci77xBOMxAUgKw8S9uPkAa/97gehYfr+B66ibD2sNeUkswS1Jlw9aQbx6Jm3V2fgxIO9ktlBV4GdlwMjhrthaJjTHaonjhnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 161316774982654.61669147376642; Fri, 12 Feb 2021 14:09:09 -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-567--tb1c6U4OtGn6lHvHbhLwg-1; Fri, 12 Feb 2021 17:07:49 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3289C8710E0; Fri, 12 Feb 2021 22:07:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C6447086E; Fri, 12 Feb 2021 22:07:43 +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 CA5D057DFA; Fri, 12 Feb 2021 22:07:42 +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 11CM7Ncn006147 for ; Fri, 12 Feb 2021 17:07:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1736E100239A; Fri, 12 Feb 2021 22:07:23 +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 D25FF1002388 for ; Fri, 12 Feb 2021 22:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613167746; 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=6GvLqd3MLiwMgIh8Wp0ImjqZs2uq4SUN6X4lDfuaPLE=; b=GXaJakNpupPBdp0Lg59K4QpbiZTyrUzC+rPxkkAgnaMqR5iYaJS0/am4nC2h1KWU5aTe7T EVSV6ubCb/6Ho26DotIlZN3z/32O8EjbA4bbDUoDkXkQHy1dxPaX4qjapps4Ezz4/M9xgX Bht0PwPvBJPUTL1Rubkm1a3L3Fk4fDs= X-MC-Unique: -tb1c6U4OtGn6lHvHbhLwg-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 4/9] esx: switch VIR_FREE->g_free in esx*Free*() Date: Fri, 12 Feb 2021 17:07:12 -0500 Message-Id: <20210212220717.910294-5-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.13 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" Although the three functions esxFreePrivate(), esxFreeStreamPrivate(), and esxUtil_FreeParsedUri() are calling VIR_FREE on *object, and so in theory the caller of the function might rely on "object" (the free function's arg) being set to NULL, in practice these functions are only called from a couple places each, and in all cases the pointer that is passed is a local variable, and goes out of scope almost immediately after calling the Free function, so it is safe to change VIR_FREE() into g_free(). Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 2 +- src/esx/esx_stream.c | 4 ++-- src/esx/esx_util.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8afec464dd..952e769376 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -71,7 +71,7 @@ esxFreePrivate(esxPrivate **priv) esxUtil_FreeParsedUri(&(*priv)->parsedUri); virObjectUnref((*priv)->caps); virObjectUnref((*priv)->xmlopt); - VIR_FREE(*priv); + g_free(*priv); } =20 =20 diff --git a/src/esx/esx_stream.c b/src/esx/esx_stream.c index cc48c182d9..131fbc100b 100644 --- a/src/esx/esx_stream.c +++ b/src/esx/esx_stream.c @@ -336,8 +336,8 @@ esxFreeStreamPrivate(esxStreamPrivate **priv) return; =20 esxVI_CURL_Free(&(*priv)->curl); - VIR_FREE((*priv)->backlog); - VIR_FREE(*priv); + g_free((*priv)->backlog); + g_free(*priv); } =20 static int diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index 64a2c968f0..e9b74f386f 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -171,12 +171,12 @@ esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri) if (!parsedUri || !(*parsedUri)) return; =20 - VIR_FREE((*parsedUri)->transport); - VIR_FREE((*parsedUri)->vCenter); - VIR_FREE((*parsedUri)->proxy_hostname); - VIR_FREE((*parsedUri)->path); + g_free((*parsedUri)->transport); + g_free((*parsedUri)->vCenter); + g_free((*parsedUri)->proxy_hostname); + g_free((*parsedUri)->path); =20 - VIR_FREE(*parsedUri); + g_free(*parsedUri); } =20 =20 --=20 2.29.2