qemuMonitorGetMemoryDeviceInfo: virHashNew cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-05 16:03:19 +02:00
parent 0ed26fca81
commit 00f4820951

View File

@ -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);