From 0e9fadd66d48861314727028d363c52053c8455d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 14 Apr 2015 15:17:10 +0200 Subject: [PATCH] qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities --- src/qemu/qemu_monitor.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0606a5f2e8..6a6ccf932c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon, int qemuMonitorSetCapabilities(qemuMonitorPtr mon) { - int ret; VIR_DEBUG("mon=%p", mon); if (!mon) { @@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon) return -1; } - if (mon->json) { - ret = qemuMonitorJSONSetCapabilities(mon); - if (ret < 0) - goto cleanup; - } else { - ret = 0; - } + if (!mon->json) + return 0; - cleanup: - return ret; + return qemuMonitorJSONSetCapabilities(mon); }