From f7d9dd8ff8547469375738f17ba1edc7afe97120 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 30 Nov 2021 11:35:42 +0100 Subject: [PATCH] virNWFilterBuildAll: Automatically free temporary GHashTable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko Reviewed-by: Martin Kletzander --- src/nwfilter/nwfilter_gentech_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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,