From: Tim Wiederhake Date: Tue, 6 Jul 2021 12:37:59 +0000 (+0200) Subject: qemuMonitorGetChardevInfo: `virHashNew` cannot return NULL X-Git-Tag: v7.6.0-rc1~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=772a9875f7dfa636498e281691684799971e3422;p=thirdparty%2Flibvirt.git qemuMonitorGetChardevInfo: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 769866e585..a2df1a6ec3 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2884,15 +2884,12 @@ int qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo) { - g_autoptr(GHashTable) info = NULL; + g_autoptr(GHashTable) info = virHashNew(qemuMonitorChardevInfoFree); VIR_DEBUG("retinfo=%p", retinfo); QEMU_CHECK_MONITOR(mon); - if (!(info = virHashNew(qemuMonitorChardevInfoFree))) - return -1; - if (qemuMonitorJSONGetChardevInfo(mon, info) < 0) return -1;