mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 16:15:19 +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
|
||||
virNWFilterObjListFree(virNWFilterObjList *nwfilters)
|
||||
{
|
||||
if (!nwfilters)
|
||||
return;
|
||||
|
||||
g_hash_table_unref(nwfilters->objs);
|
||||
g_hash_table_unref(nwfilters->objsName);
|
||||
g_free(nwfilters);
|
||||
|
Loading…
x
Reference in New Issue
Block a user