virStoragePoolObjListNew: 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:33:59 +02:00
parent a16e4dd751
commit cd6ec91705

View File

@ -398,11 +398,8 @@ virStoragePoolObjListNew(void)
if (!(pools = virObjectRWLockableNew(virStoragePoolObjListClass)))
return NULL;
if (!(pools->objs = virHashNew(virObjectFreeHashData)) ||
!(pools->objsName = virHashNew(virObjectFreeHashData))) {
virObjectUnref(pools);
return NULL;
}
pools->objs = virHashNew(virObjectFreeHashData);
pools->objsName = virHashNew(virObjectFreeHashData);
return pools;
}