From: Tim Wiederhake Date: Mon, 5 Jul 2021 14:03:19 +0000 (+0200) Subject: qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL X-Git-Tag: v7.6.0-rc1~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00f4820951d6f5945580d7bb97801e7a981ad1f2;p=thirdparty%2Flibvirt.git qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0b5da8b71f..f66a3457c1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,7 +4214,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { - g_autoptr(GHashTable) hash = NULL; + g_autoptr(GHashTable) hash = virHashNew(g_free); int ret; VIR_DEBUG("info=%p", info); @@ -4223,9 +4223,6 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, QEMU_CHECK_MONITOR(mon); - if (!(hash = virHashNew(g_free))) - return -1; - if ((ret = qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >= 0) *info = g_steal_pointer(&hash);