mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +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
a6853d691b
commit
a63665c041
@ -199,7 +199,7 @@ static GHashTable *
|
|||||||
virNWFilterCreateVarsFrom(GHashTable *vars1,
|
virNWFilterCreateVarsFrom(GHashTable *vars1,
|
||||||
GHashTable *vars2)
|
GHashTable *vars2)
|
||||||
{
|
{
|
||||||
GHashTable *res = virHashNew(virNWFilterVarValueHashFree);
|
g_autoptr(GHashTable) res = virHashNew(virNWFilterVarValueHashFree);
|
||||||
|
|
||||||
if (virNWFilterHashTablePutAll(vars1, res) < 0)
|
if (virNWFilterHashTablePutAll(vars1, res) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -207,10 +207,9 @@ virNWFilterCreateVarsFrom(GHashTable *vars1,
|
|||||||
if (virNWFilterHashTablePutAll(vars2, res) < 0)
|
if (virNWFilterHashTablePutAll(vars2, res) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return res;
|
return g_steal_pointer(&res);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virHashFree(res);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user