mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemuMonitorGetPRManagerInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
df27180d49
commit
cdcbdd25e1
@ -4516,21 +4516,18 @@ qemuMonitorGetPRManagerInfo(qemuMonitor *mon,
|
|||||||
GHashTable **retinfo)
|
GHashTable **retinfo)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
GHashTable *info = NULL;
|
g_autoptr(GHashTable) info = virHashNew(g_free);
|
||||||
|
|
||||||
*retinfo = NULL;
|
*retinfo = NULL;
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
info = virHashNew(g_free);
|
|
||||||
|
|
||||||
if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0)
|
if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
*retinfo = g_steal_pointer(&info);
|
*retinfo = g_steal_pointer(&info);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virHashFree(info);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user