Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/qemu/qemu_monitor.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index f03d6106f9..2c43cc0788 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2885,25 +2885,21 @@ int
qemuMonitorGetChardevInfo(qemuMonitor *mon,
GHashTable **retinfo)
{
- GHashTable *info = NULL;
+ g_autoptr(GHashTable) info = NULL;
VIR_DEBUG("retinfo=%p", retinfo);
- QEMU_CHECK_MONITOR_GOTO(mon, error);
+ QEMU_CHECK_MONITOR(mon);
+ *retinfo = NULL;
if (!(info = virHashNew(qemuMonitorChardevInfoFree)))
- goto error;
+ return -1;
if (qemuMonitorJSONGetChardevInfo(mon, info) < 0)
- goto error;
+ return -1;
- *retinfo = info;
+ *retinfo = g_steal_pointer(&info);
return 0;
-
- error:
- virHashFree(info);
- *retinfo = NULL;
- return -1;
}
--
2.31.1