From: Peter Krempa Date: Tue, 30 Nov 2021 10:35:42 +0000 (+0100) Subject: virNWFilterBuildAll: Automatically free temporary GHashTable X-Git-Tag: v8.0.0-rc1~426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7d9dd8ff8547469375738f17ba1edc7afe97120;p=thirdparty%2Flibvirt.git virNWFilterBuildAll: 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 55c7571ea5..ea1f4f4092 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -979,7 +979,8 @@ virNWFilterBuildAll(virNWFilterDriverState *driver, VIR_DEBUG("Build all filters newFilters=%d", newFilters); if (newFilters) { - data.skipInterfaces = virHashNew(NULL); + g_autoptr(GHashTable) skipInterfaces = virHashNew(NULL); + data.skipInterfaces = skipInterfaces; data.step = STEP_APPLY_NEW; if (virNWFilterBindingObjListForEach(driver->bindings, @@ -998,8 +999,6 @@ virNWFilterBuildAll(virNWFilterDriverState *driver, virNWFilterBuildIter, &data); } - - virHashFree(data.skipInterfaces); } else { data.step = STEP_APPLY_CURRENT; if (virNWFilterBindingObjListForEach(driver->bindings,