[PATCH 17/23] nwfilterxml2firewalltest: testCompareXMLToArgvFiles: Automatically free GHashTable

Peter Krempa posted 23 patches 4 years, 2 months ago
[PATCH 17/23] nwfilterxml2firewalltest: testCompareXMLToArgvFiles: Automatically free GHashTable
Posted by Peter Krempa 4 years, 2 months ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/nwfilterxml2firewalltest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c
index 6ab62f60c9..315afddca0 100644
--- a/tests/nwfilterxml2firewalltest.c
+++ b/tests/nwfilterxml2firewalltest.c
@@ -350,7 +350,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
 {
     g_autofree char *actualargv = NULL;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-    GHashTable *vars = virHashNew(virNWFilterVarValueHashFree);
+    g_autoptr(GHashTable) vars = virHashNew(virNWFilterVarValueHashFree);
     virNWFilterInst inst;
     int ret = -1;
     g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
@@ -381,7 +381,6 @@ static int testCompareXMLToArgvFiles(const char *xml,

  cleanup:
     virNWFilterInstReset(&inst);
-    virHashFree(vars);
     return ret;
 }

-- 
2.31.1

Re: [PATCH 17/23] nwfilterxml2firewalltest: testCompareXMLToArgvFiles: Automatically free GHashTable
Posted by Ján Tomko 4 years, 2 months ago
On a Tuesday in 2021, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/nwfilterxml2firewalltest.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano