mirror of https://gitee.com/openkylin/libvirt.git
qemuMonitorGetBlockInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b1dd164b1a
commit
e2f27936f1
src/qemu
|
@ -2103,7 +2103,7 @@ qemuDomainDiskInfoFree(void *value)
|
|||
GHashTable *
|
||||
qemuMonitorGetBlockInfo(qemuMonitor *mon)
|
||||
{
|
||||
GHashTable *table;
|
||||
g_autoptr(GHashTable) table = NULL;
|
||||
|
||||
QEMU_CHECK_MONITOR_NULL(mon);
|
||||
|
||||
|
@ -2111,11 +2111,10 @@ qemuMonitorGetBlockInfo(qemuMonitor *mon)
|
|||
return NULL;
|
||||
|
||||
if (qemuMonitorJSONGetBlockInfo(mon, table) < 0) {
|
||||
virHashFree(table);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return table;
|
||||
return g_steal_pointer(&table);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue