From: Michal Privoznik Date: Fri, 22 Oct 2021 05:07:09 +0000 (+0200) Subject: qemuMonitorJSONGetMigrationStats: Don't clear @stats on failure X-Git-Tag: v7.9.0-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e8bb57859e60570317c59c2fdc6b223af3be1a2;p=thirdparty%2Flibvirt.git 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 --- 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;