mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
committed by
Michal Privoznik
parent
b1dd164b1a
commit
e2f27936f1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user