提交 0e9fadd6 编写于 作者: P Peter Krempa

qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities

上级 119aa5d3
...@@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon, ...@@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
int int
qemuMonitorSetCapabilities(qemuMonitorPtr mon) qemuMonitorSetCapabilities(qemuMonitorPtr mon)
{ {
int ret;
VIR_DEBUG("mon=%p", mon); VIR_DEBUG("mon=%p", mon);
if (!mon) { if (!mon) {
...@@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon) ...@@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon)
return -1; return -1;
} }
if (mon->json) { if (!mon->json)
ret = qemuMonitorJSONSetCapabilities(mon); return 0;
if (ret < 0)
goto cleanup;
} else {
ret = 0;
}
cleanup: return qemuMonitorJSONSetCapabilities(mon);
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册