Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/qemu/qemu_monitor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 86aabc98c3..f08b43bbfb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2155,7 +2155,7 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, bool backingChain) { int ret; - GHashTable *stats = virHashNew(g_free); + g_autoptr(GHashTable) stats = virHashNew(g_free); VIR_DEBUG("ret_stats=%p, backing=%d", ret_stats, backingChain); @@ -2165,14 +2165,10 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, ret = qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain); if (ret < 0) - goto error; + return -1; - *ret_stats = stats; + *ret_stats = g_steal_pointer(&stats); return ret; - - error: - virHashFree(stats); - return -1; } -- 2.31.1