From: Tim Wiederhake Date: Tue, 6 Jul 2021 08:20:38 +0000 (+0200) Subject: virNWFilterCreateVarsFrom: Use automatic memory management X-Git-Tag: v7.6.0-rc1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63665c041f5406547b35d173353ff3c70b0b297;p=thirdparty%2Flibvirt.git virNWFilterCreateVarsFrom: Use automatic memory management Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 7014bdfc67..29e5e0c862 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -199,7 +199,7 @@ static GHashTable * virNWFilterCreateVarsFrom(GHashTable *vars1, GHashTable *vars2) { - GHashTable *res = virHashNew(virNWFilterVarValueHashFree); + g_autoptr(GHashTable) res = virHashNew(virNWFilterVarValueHashFree); if (virNWFilterHashTablePutAll(vars1, res) < 0) goto error; @@ -207,10 +207,9 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, if (virNWFilterHashTablePutAll(vars2, res) < 0) goto error; - return res; + return g_steal_pointer(&res); error: - virHashFree(res); return NULL; }