[PATCH 22/25] nwfilter: convert remaining VIR_FREE() to g_free()

Laine Stump laine at redhat.com
Thu Jun 25 03:34:11 UTC 2020


Signed-off-by: Laine Stump <laine at redhat.com>
---
 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_dhcpsnoop.c
index 32cd6492ad..e41062feca 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -314,7 +314,7 @@ virNWFilterSnoopCancel(char **threadKey)
     virNWFilterSnoopActiveLock();
 
     ignore_value(virHashRemoveEntry(virNWFilterSnoopState.active, *threadKey));
-    VIR_FREE(*threadKey);
+    g_free(*threadKey);
 
     virNWFilterSnoopActiveUnlock();
 }
@@ -600,7 +600,7 @@ virNWFilterSnoopReqFree(virNWFilterSnoopReqPtr req)
     virCondDestroy(&req->threadStatusCond);
     virFreeError(req->threadError);
 
-    VIR_FREE(req);
+    g_free(req);
 }
 
 /*
@@ -731,7 +731,7 @@ virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req,
 
     if (req->threadkey && virNWFilterSnoopIPLeaseInstallRule(pl, true) < 0) {
         virNWFilterSnoopReqUnlock(req);
-        VIR_FREE(pl);
+        g_free(pl);
         return -1;
     }
 
@@ -850,7 +850,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
     }
 
  skip_instantiate:
-    VIR_FREE(ipl);
+    g_free(ipl);
 
     ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));
 
@@ -1149,7 +1149,7 @@ virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPoolPtr pool,
     if (ret == 0)
         g_atomic_int_add(qCtr, 1);
     else
-        VIR_FREE(job);
+        g_free(job);
 
     return ret;
 }
@@ -1502,7 +1502,7 @@ virNWFilterDHCPSnoopThread(void *req0)
     ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
                                     req->binding->portdevname));
 
-    VIR_FREE(req->binding->portdevname);
+    g_free(req->binding->portdevname);
 
     virNWFilterSnoopReqUnlock(req);
     virNWFilterSnoopUnlock();
@@ -1970,7 +1970,7 @@ virNWFilterSnoopRemAllReqIter(const void *payload,
          */
         virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, NULL);
 
-        VIR_FREE(req->binding->portdevname);
+        g_free(req->binding->portdevname);
     }
 
     virNWFilterSnoopReqUnlock(req);
@@ -2079,7 +2079,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname)
         /* keep valid lease req; drop interface association */
         virNWFilterSnoopCancel(&req->threadkey);
 
-        VIR_FREE(req->binding->portdevname);
+        g_free(req->binding->portdevname);
 
         virNWFilterSnoopReqUnlock(req);
 
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,
 
  err_free_driverstate:
     virNWFilterObjListFree(driver->nwfilters);
-    VIR_FREE(driver);
+    g_free(driver);
 
     return VIR_DRV_STATE_INIT_ERROR;
 }
@@ -367,9 +367,9 @@ nwfilterStateCleanup(void)
         if (driver->lockFD != -1)
             virPidFileRelease(driver->stateDir, "driver", driver->lockFD);
 
-        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();
     }
 
@@ -379,7 +379,7 @@ nwfilterStateCleanup(void)
     virNWFilterObjListFree(driver->nwfilters);
 
     virMutexDestroy(&driver->lock);
-    VIR_FREE(driver);
+    g_free(driver);
 
     return 0;
 }
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index b382b9405d..6e05e638aa 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -3518,7 +3518,7 @@ ebiptablesApplyNewRules(const char *ifname,
 
  cleanup:
     for (i = 0; i < nsubchains; i++)
-        VIR_FREE(subchains[i]);
+        g_free(subchains[i]);
 
     return ret;
 }
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index f586c7e938..183e2f0a91 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -122,7 +122,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
         return;
 
     virHashFree(inst->vars);
-    VIR_FREE(inst);
+    g_free(inst);
 }
 
 
@@ -234,12 +234,12 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
 
     for (i = 0; i < inst->nfilters; i++)
         virNWFilterObjUnlock(inst->filters[i]);
-    VIR_FREE(inst->filters);
+    g_free(inst->filters);
     inst->nfilters = 0;
 
     for (i = 0; i < inst->nrules; i++)
         virNWFilterRuleInstFree(inst->rules[i]);
-    VIR_FREE(inst->rules);
+    g_free(inst->rules);
 }
 
 
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index 7bb39c3a66..c72ae23e4c 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 err_exit;
         }
 
@@ -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 err_exit;
         }
 
         while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) {
-            VIR_FREE(ifaceLock);
+            g_free(ifaceLock);
             goto err_exit;
         }
 
@@ -221,7 +221,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReqPtr req)
 
     virNWFilterBindingDefFree(req->binding);
 
-    VIR_FREE(req);
+    g_free(req);
 }
 
 
-- 
2.25.4




More information about the libvir-list mailing list