1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

qemuMonitorGetChardevInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-06 14:37:58 +02:00 committed by Michal Privoznik
parent 9a4402dd91
commit c30410a0c4

@ -2884,25 +2884,20 @@ 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);
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;
}