From 4e8bb57859e60570317c59c2fdc6b223af3be1a2 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 22 Oct 2021 07:07:09 +0200 Subject: [PATCH] qemuMonitorJSONGetMigrationStats: Don't clear @stats on failure In the qemuMonitorJSONGetMigrationStats() there's a code under cleanup label that's clearing returned @stats if the function returns with an error. However, transitively there's just one caller - qemuMigrationAnyFetchStats() - and it doesn't care for this behaviour. Drop the code to simplify the cleanup label. Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- src/qemu/qemu_monitor_json.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7833038a06..bcbb4e59ab 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3542,8 +3542,6 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon, ret = 0; cleanup: - if (ret < 0) - memset(stats, 0, sizeof(*stats)); virJSONValueFree(cmd); virJSONValueFree(reply); return ret; -- 2.47.2