]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
iptablesPrivateChainCreate: `virHashNew` cannot return NULL
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 13:44:20 +0000 (15:44 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Wed, 14 Jul 2021 13:36:27 +0000 (15:36 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/viriptables.c

index 41895782451ac1d4bc74ca6142546200ab27c808..198ece3d715d839983300eedf188a71aced91e31 100644 (file)
@@ -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" */