mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
virNWFilterCreateVarsFrom: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
a51af3d030
commit
b658836529
@ -148,7 +148,7 @@ static GHashTable *
|
||||
virNWFilterCreateVarsFrom(GHashTable *vars1,
|
||||
GHashTable *vars2)
|
||||
{
|
||||
GHashTable *res = virHashNew(virNWFilterVarValueHashFree);
|
||||
g_autoptr(GHashTable) res = virHashNew(virNWFilterVarValueHashFree);
|
||||
|
||||
if (virNWFilterHashTablePutAll(vars1, res) < 0)
|
||||
goto err_exit;
|
||||
@ -156,10 +156,9 @@ virNWFilterCreateVarsFrom(GHashTable *vars1,
|
||||
if (virNWFilterHashTablePutAll(vars2, res) < 0)
|
||||
goto err_exit;
|
||||
|
||||
return res;
|
||||
return g_steal_pointer(&res);
|
||||
|
||||
err_exit:
|
||||
virHashFree(res);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user