From: Tim Wiederhake Date: Mon, 5 Jul 2021 14:51:35 +0000 (+0200) Subject: virChrdevAlloc: `virHashNew` cannot return NULL X-Git-Tag: v7.6.0-rc1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb7260c7d88e586dd941ea2e4a4c48c3efde61b4;p=thirdparty%2Flibvirt.git virChrdevAlloc: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 91f2b5a233..5d6de68427 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -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; } /**