1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

virDomainObjListNew: 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-05 16:57:21 +02:00
parent bb3a57c8b0
commit 885ee2aa1f

View File

@ -75,12 +75,8 @@ virDomainObjList *virDomainObjListNew(void)
if (!(doms = virObjectRWLockableNew(virDomainObjListClass)))
return NULL;
if (!(doms->objs = virHashNew(virObjectFreeHashData)) ||
!(doms->objsName = virHashNew(virObjectFreeHashData))) {
virObjectUnref(doms);
return NULL;
}
doms->objs = virHashNew(virObjectFreeHashData);
doms->objsName = virHashNew(virObjectFreeHashData);
return doms;
}