From 7bf435fbb07b8daae43c5a1e9b7a3c40158bad56 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 5 Jul 2021 15:44:20 +0200 Subject: [PATCH] iptablesPrivateChainCreate: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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" */