virNodeDeviceObjListNew: 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 10:06:35 +02:00
parent 4a40b9a4fd
commit 3fab2688ac

View File

@ -456,10 +456,7 @@ virNodeDeviceObjListNew(void)
if (!(devs = virObjectRWLockableNew(virNodeDeviceObjListClass)))
return NULL;
if (!(devs->objs = virHashNew(virObjectFreeHashData))) {
virObjectUnref(devs);
return NULL;
}
devs->objs = virHashNew(virObjectFreeHashData);
return devs;
}