mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-29 16:05:17 +00:00
virNWFilterObjListFree: Prevent null pointer derefernce
Allow virNWFilterObjListFree to be called with a NULL argument. This enables a later patch to use virNWFilterObjListFree as a cleanup function safely, as it is a no-op if virNWFilterObj was not yet initialized. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
74884bef1e
commit
db2989c3a5
@ -110,6 +110,9 @@ virNWFilterObjFree(virNWFilterObj *obj)
|
|||||||
void
|
void
|
||||||
virNWFilterObjListFree(virNWFilterObjList *nwfilters)
|
virNWFilterObjListFree(virNWFilterObjList *nwfilters)
|
||||||
{
|
{
|
||||||
|
if (!nwfilters)
|
||||||
|
return;
|
||||||
|
|
||||||
g_hash_table_unref(nwfilters->objs);
|
g_hash_table_unref(nwfilters->objs);
|
||||||
g_hash_table_unref(nwfilters->objsName);
|
g_hash_table_unref(nwfilters->objsName);
|
||||||
g_free(nwfilters);
|
g_free(nwfilters);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user