]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorGetChardevInfo: `virHashNew` cannot return NULL
authorTim Wiederhake <twiederh@redhat.com>
Tue, 6 Jul 2021 12:37:59 +0000 (14:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 13 Jul 2021 12:40:28 +0000 (14:40 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_monitor.c

index 769866e585268009d4e01c4c2ab3662c55d323c3..a2df1a6ec385db32a9456bf949e658b72d032238 100644 (file)
@@ -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;