mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
virstorageobj: Don't clear vols if they weren't initialized
If virStoragePoolObjNew() fails to create new volume object list then virObjectUnref() is called and since refcounter is 1 then virStoragePoolObjDispose() is called which in turn calls virStoragePoolObjClearVols() which in turn dereferences obj->volumes. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
e34c028af1
commit
0cf3bb805c
@ -619,6 +619,9 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr obj,
|
|||||||
void
|
void
|
||||||
virStoragePoolObjClearVols(virStoragePoolObjPtr obj)
|
virStoragePoolObjClearVols(virStoragePoolObjPtr obj)
|
||||||
{
|
{
|
||||||
|
if (!obj->volumes)
|
||||||
|
return;
|
||||||
|
|
||||||
virHashRemoveAll(obj->volumes->objsKey);
|
virHashRemoveAll(obj->volumes->objsKey);
|
||||||
virHashRemoveAll(obj->volumes->objsName);
|
virHashRemoveAll(obj->volumes->objsName);
|
||||||
virHashRemoveAll(obj->volumes->objsPath);
|
virHashRemoveAll(obj->volumes->objsPath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user