[PATCH 04/23] virNWFilterDoInstantiate: Automatically free temporary GHashTable

Peter Krempa pkrempa at redhat.com
Tue Nov 30 14:31:48 UTC 2021


Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/nwfilter/nwfilter_gentech_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index ecba16d55c..55c7571ea5 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -493,8 +493,7 @@ virNWFilterDoInstantiate(virNWFilterTechDriver *techdriver,
     virNWFilterVarValue *lv;
     const char *learning;
     bool reportIP = false;
-
-    GHashTable *missing_vars = virHashNew(virNWFilterVarValueHashFree);
+    g_autoptr(GHashTable) missing_vars = virHashNew(virNWFilterVarValueHashFree);

     memset(&inst, 0, sizeof(inst));

@@ -593,7 +592,6 @@ virNWFilterDoInstantiate(virNWFilterTechDriver *techdriver,

  error:
     virNWFilterInstReset(&inst);
-    virHashFree(missing_vars);

     return rc;

-- 
2.31.1




More information about the libvir-list mailing list