On a Tuesday in 2020, Laine Stump wrote:
Signed-off-by: Laine Stump <la...@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 64671af135..aafa6de322 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);

This one should use g_clear_pointer.


    virNWFilterSnoopActiveUnlock();
}
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);

Same here.


    return VIR_DRV_STATE_INIT_ERROR;
}
@@ -379,7 +379,7 @@ nwfilterStateCleanup(void)
    virNWFilterObjListFree(driver->nwfilters);

    virMutexDestroy(&driver->lock);
-    VIR_FREE(driver);
+    g_free(driver);


Possibly here.

    return 0;
}

(I have not verified whether the double use of the pointer may
practically happen, but we do a non-NULL check of these in a few cases)

Reviewed-by: Ján Tomko <jto...@redhat.com>

Jano

Attachment: signature.asc
Description: PGP signature

Reply via email to