From nobody Mon Nov 25 21:50:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594156511; cv=none; d=zohomail.com; s=zohoarc; b=HQMhubw5Ue20R8XJ+coIN5W1gOfvOPA3N6Db6F3nWgL2Ra8RdDgVusi1JBN7HMIlZH/Xu7txV0Ar0CiWdoJsg3YCBEPgC/fBpQ7EHPX6gJWHk6kJwO2pa0XNNu0mBjaYw0M71gey9HAhNmGvociZaxfsJ9LgAxDA/INuYw5v9BE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594156511; 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=tuH7lm9x3qMfu2EI0nAX3sJNuOUbHJ4JomqGskk+6cY=; b=ABPQnGvXvciDOSiy5HWQJY5i/ZUEjGl6QyqeqLwHsgltYocOY/zWTV1LOngW0k56LoR7I14/SeADSTje8MFL8zOSSwCZNJmImsUjVosHBHHxug2D+YezYdHCCoT5l1LMt/XCPidvdTwgEQJztV5fAMTy18b4wUBE6g1IXzbIzJM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594156511527807.1476911150816; Tue, 7 Jul 2020 14:15:11 -0700 (PDT) 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-100-irjtfNiMPQWgblDnGXRXhg-1; Tue, 07 Jul 2020 17:15:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B2F9804006; Tue, 7 Jul 2020 21:15:02 +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 4CF1E5D9DC; Tue, 7 Jul 2020 21:15:02 +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 1D98572F77; Tue, 7 Jul 2020 21:15:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 067L8UpW008037 for ; Tue, 7 Jul 2020 17:08:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 617E1797E0; Tue, 7 Jul 2020 21:08:30 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-194.phx2.redhat.com [10.3.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A0FE79220 for ; Tue, 7 Jul 2020 21:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594156510; 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=tuH7lm9x3qMfu2EI0nAX3sJNuOUbHJ4JomqGskk+6cY=; b=EZCy5EBfrujPcno7SpXP6E9hz4KmKxJhVsLP2VtdDpnZwQnt+VCX/bRzAzzHOSVO6B+8zE 7TZKKvnmbEGdJFmITTH9Xw1k2+qogwQG4orzqM2w8/67PzWiYsp3lHqEJJ8k6Z98KVR1Gi UZ8S0jAmBSfddsZH3ujoF9uktIEvbWc= X-MC-Unique: irjtfNiMPQWgblDnGXRXhg-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH v2 15/15] nwfilter: convert remaining VIR_FREE() to g_free() Date: Tue, 7 Jul 2020 17:08:15 -0400 Message-Id: <20200707210815.1797463-16-laine@redhat.com> In-Reply-To: <20200707210815.1797463-1-laine@redhat.com> References: <20200707210815.1797463-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.14 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" Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_dhcpsnoop.c | 16 ++++++++-------- src/nwfilter/nwfilter_driver.c | 10 +++++----- src/nwfilter/nwfilter_ebiptables_driver.c | 2 +- src/nwfilter/nwfilter_gentech_driver.c | 6 +++--- src/nwfilter/nwfilter_learnipaddr.c | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 64671af135..aafa6de322 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -314,7 +314,7 @@ virNWFilterSnoopCancel(char **threadKey) virNWFilterSnoopActiveLock(); =20 ignore_value(virHashRemoveEntry(virNWFilterSnoopState.active, *threadK= ey)); - VIR_FREE(*threadKey); + g_free(*threadKey); =20 virNWFilterSnoopActiveUnlock(); } @@ -600,7 +600,7 @@ virNWFilterSnoopReqFree(virNWFilterSnoopReqPtr req) virCondDestroy(&req->threadStatusCond); virFreeError(req->threadError); =20 - VIR_FREE(req); + g_free(req); } =20 /* @@ -731,7 +731,7 @@ virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req, =20 if (req->threadkey && virNWFilterSnoopIPLeaseInstallRule(pl, true) < 0= ) { virNWFilterSnoopReqUnlock(req); - VIR_FREE(pl); + g_free(pl); return -1; } =20 @@ -850,7 +850,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req, } =20 skip_instantiate: - VIR_FREE(ipl); + g_free(ipl); =20 ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLease= s)); =20 @@ -1149,7 +1149,7 @@ virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPoolPtr = pool, if (ret =3D=3D 0) g_atomic_int_add(qCtr, 1); else - VIR_FREE(job); + g_free(job); =20 return ret; } @@ -1502,7 +1502,7 @@ virNWFilterDHCPSnoopThread(void *req0) ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey, req->binding->portdevname)); =20 - VIR_FREE(req->binding->portdevname); + g_clear_pointer(&req->binding->portdevname, g_free); =20 virNWFilterSnoopReqUnlock(req); virNWFilterSnoopUnlock(); @@ -1970,7 +1970,7 @@ virNWFilterSnoopRemAllReqIter(const void *payload, */ virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, NULL); =20 - VIR_FREE(req->binding->portdevname); + g_clear_pointer(&req->binding->portdevname, g_free); } =20 virNWFilterSnoopReqUnlock(req); @@ -2079,7 +2079,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname) /* keep valid lease req; drop interface association */ virNWFilterSnoopCancel(&req->threadkey); =20 - VIR_FREE(req->binding->portdevname); + g_clear_pointer(&req->binding->portdevname, g_free); =20 virNWFilterSnoopReqUnlock(req); =20 diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 39d0a2128e..7853ad59fa 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -303,7 +303,7 @@ nwfilterStateInitialize(bool privileged, =20 err_free_driverstate: virNWFilterObjListFree(driver->nwfilters); - VIR_FREE(driver); + g_free(driver); =20 return VIR_DRV_STATE_INIT_ERROR; } @@ -367,9 +367,9 @@ nwfilterStateCleanup(void) if (driver->lockFD !=3D -1) virPidFileRelease(driver->stateDir, "driver", driver->lockFD); =20 - VIR_FREE(driver->stateDir); - VIR_FREE(driver->configDir); - VIR_FREE(driver->bindingDir); + g_free(driver->stateDir); + g_free(driver->configDir); + g_free(driver->bindingDir); nwfilterDriverUnlock(); } =20 @@ -379,7 +379,7 @@ nwfilterStateCleanup(void) virNWFilterObjListFree(driver->nwfilters); =20 virMutexDestroy(&driver->lock); - VIR_FREE(driver); + g_free(driver); =20 return 0; } diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 9c9d63f14b..6aefbe226b 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3517,7 +3517,7 @@ ebiptablesApplyNewRules(const char *ifname, =20 cleanup: for (i =3D 0; i < nsubchains; i++) - VIR_FREE(subchains[i]); + g_free(subchains[i]); =20 return ret; } diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter= _gentech_driver.c index 071f15caea..c93f2ed18f 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -122,7 +122,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst) return; =20 virHashFree(inst->vars); - VIR_FREE(inst); + g_free(inst); } =20 =20 @@ -234,12 +234,12 @@ virNWFilterInstReset(virNWFilterInstPtr inst) =20 for (i =3D 0; i < inst->nfilters; i++) virNWFilterObjUnlock(inst->filters[i]); - VIR_FREE(inst->filters); + g_free(inst->filters); inst->nfilters =3D 0; =20 for (i =3D 0; i < inst->nrules; i++) virNWFilterRuleInstFree(inst->rules[i]); - VIR_FREE(inst->rules); + g_free(inst->rules); inst->nrules =3D 0; } =20 diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index abef0b6457..c6497450eb 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -156,7 +156,7 @@ virNWFilterLockIface(const char *ifname) if (virMutexInitRecursive(&ifaceLock->lock) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("mutex initialization failed")); - VIR_FREE(ifaceLock); + g_free(ifaceLock); goto error; } =20 @@ -165,12 +165,12 @@ virNWFilterLockIface(const char *ifname) _("interface name %s does not fit into " "buffer "), ifaceLock->ifname); - VIR_FREE(ifaceLock); + g_free(ifaceLock); goto error; } =20 while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) { - VIR_FREE(ifaceLock); + g_free(ifaceLock); goto error; } =20 @@ -221,7 +221,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReq= Ptr req) =20 virNWFilterBindingDefFree(req->binding); =20 - VIR_FREE(req); + g_free(req); } =20 =20 --=20 2.25.4