提交 0cf3bb80 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 e34c028a
......@@ -619,6 +619,9 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr obj,
void
virStoragePoolObjClearVols(virStoragePoolObjPtr obj)
{
if (!obj->volumes)
return;
virHashRemoveAll(obj->volumes->objsKey);
virHashRemoveAll(obj->volumes->objsName);
virHashRemoveAll(obj->volumes->objsPath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册