mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
d79a5e4e1b
commit
cb7260c7d8
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue