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:
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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user