]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuInteropFetchConfigs: `virHashNew` cannot return NULL
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 13:56:00 +0000 (15:56 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Fri, 23 Jul 2021 09:30:46 +0000 (11:30 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_interop_config.c

index ea2afcc0703ba5b396607e47322a4f95f1ab45e7..848e8f738134b31e9f1cb8582b42779f64d4e6c8 100644 (file)
@@ -88,7 +88,7 @@ qemuInteropFetchConfigs(const char *name,
                         char ***configs,
                         bool privileged)
 {
-    g_autoptr(GHashTable) files = NULL;
+    g_autoptr(GHashTable) files = virHashNew(g_free);
     g_autofree char *homeConfig = NULL;
     g_autofree char *xdgConfig = NULL;
     g_autofree char *sysLocation = virFileBuildPath(QEMU_SYSTEM_LOCATION, name, NULL);
@@ -117,9 +117,6 @@ qemuInteropFetchConfigs(const char *name,
         homeConfig = g_strdup_printf("%s/qemu/%s", xdgConfig, name);
     }
 
-    if (!(files = virHashNew(g_free)))
-        return -1;
-
     if (qemuBuildFileList(files, sysLocation) < 0)
         return -1;