virStorageVolObjListNew: virHashNew cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-06 13:34:44 +02:00
parent cc69362e36
commit 7b8d4d99b5

View File

@ -170,12 +170,9 @@ virStorageVolObjListNew(void)
if (!(vols = virObjectRWLockableNew(virStorageVolObjListClass)))
return NULL;
if (!(vols->objsKey = virHashNew(virObjectFreeHashData)) ||
!(vols->objsName = virHashNew(virObjectFreeHashData)) ||
!(vols->objsPath = virHashNew(virObjectFreeHashData))) {
virObjectUnref(vols);
return NULL;
}
vols->objsKey = virHashNew(virObjectFreeHashData);
vols->objsName = virHashNew(virObjectFreeHashData);
vols->objsPath = virHashNew(virObjectFreeHashData);
return vols;
}