1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

virChrdevAlloc: 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:51:35 +02:00
parent d79a5e4e1b
commit cb7260c7d8

View File

@ -265,13 +265,9 @@ virChrdevs *virChrdevAlloc(void)
/* there will hardly be any devices most of the time, the hash
* does not have to be huge */
if (!(devs->hash = virHashNew(virChrdevHashEntryFree)))
goto error;
devs->hash = virHashNew(virChrdevHashEntryFree);
return devs;
error:
virChrdevFree(devs);
return NULL;
}
/**