mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
virNWFilterObjListFree: Don't leak nwfilters->objs
When adding a nwfilter onto the list in virNWFilterObjListAssignDef() this array is re-allocated to match demand for new size. However, it is never freed leading to a leak: ==26535== 136 bytes in 1 blocks are definitely lost in loss record 1,079 of 1,250 ==26535== at 0x4C2E2BE: realloc (vg_replace_malloc.c:785) ==26535== by 0x54BA28E: virReallocN (viralloc.c:245) ==26535== by 0x54BA384: virExpandN (viralloc.c:294) ==26535== by 0x54BA657: virInsertElementsN (viralloc.c:436) ==26535== by 0x55DB011: virNWFilterObjListAssignDef (virnwfilterobj.c:362) ==26535== by 0x55DB530: virNWFilterObjListLoadConfig (virnwfilterobj.c:503) ==26535== by 0x55DB635: virNWFilterObjListLoadAllConfigs (virnwfilterobj.c:539) ==26535== by 0x2AC5A28B: nwfilterStateInitialize (nwfilter_driver.c:250) ==26535== by 0x5621C64: virStateInitialize (libvirt.c:770) ==26535== by 0x124379: daemonRunStateInit (libvirtd.c:881) ==26535== by 0x554AC78: virThreadHelper (virthread.c:206) ==26535== by 0x8F5F493: start_thread (in /lib64/libpthread-2.23.so) Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
033369c7d9
commit
772e42473f
@ -110,6 +110,7 @@ virNWFilterObjListFree(virNWFilterObjListPtr nwfilters)
|
||||
size_t i;
|
||||
for (i = 0; i < nwfilters->count; i++)
|
||||
virNWFilterObjFree(nwfilters->objs[i]);
|
||||
VIR_FREE(nwfilters->objs);
|
||||
VIR_FREE(nwfilters);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user