From: Peter Krempa Date: Tue, 30 Nov 2021 10:35:42 +0000 (+0100) Subject: virNWFilterDoInstantiate: Automatically free temporary GHashTable X-Git-Tag: v8.0.0-rc1~427 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdcd102eefc72463c285d26b342d840a4c5a5c42;p=thirdparty%2Flibvirt.git virNWFilterDoInstantiate: Automatically free temporary GHashTable Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko Reviewed-by: Martin Kletzander --- 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;