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:
Tim Wiederhake 2021-07-06 14:37:55 +02:00 committed by Michal Privoznik
parent b1dd164b1a
commit e2f27936f1
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}