From: Tim Wiederhake Date: Mon, 5 Jul 2021 13:44:20 +0000 (+0200) Subject: iptablesPrivateChainCreate: `virHashNew` cannot return NULL X-Git-Tag: v7.6.0-rc1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf435fbb07b8daae43c5a1e9b7a3c40158bad56;p=thirdparty%2Flibvirt.git iptablesPrivateChainCreate: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 4189578245..198ece3d71 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -70,17 +70,12 @@ iptablesPrivateChainCreate(virFirewall *fw, void *opaque) { iptablesGlobalChainData *data = opaque; - GHashTable *chains = NULL; - GHashTable *links = NULL; + GHashTable *chains = virHashNew(NULL); + GHashTable *links = virHashNew(NULL); const char *const *tmp; int ret = -1; size_t i; - if (!(chains = virHashNew(NULL))) - goto cleanup; - if (!(links = virHashNew(NULL))) - goto cleanup; - tmp = lines; while (tmp && *tmp) { if (STRPREFIX(*tmp, "-N ")) { /* eg "-N LIBVIRT_INP" */