nwfilterxml2firewalltest: testCompareXMLToArgvFiles: Automatically free GHashTable

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Peter Krempa 2021-11-30 11:49:24 +01:00
parent ac5264ccd6
commit dc38b4c5bf

View File

@ -350,7 +350,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
{ {
g_autofree char *actualargv = NULL; g_autofree char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
GHashTable *vars = virHashNew(virNWFilterVarValueHashFree); g_autoptr(GHashTable) vars = virHashNew(virNWFilterVarValueHashFree);
virNWFilterInst inst; virNWFilterInst inst;
int ret = -1; int ret = -1;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew(); g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
@ -381,7 +381,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
cleanup: cleanup:
virNWFilterInstReset(&inst); virNWFilterInstReset(&inst);
virHashFree(vars);
return ret; return ret;
} }