提交 3af81868 编写于 作者: M Michal Privoznik

qemuMonitorJSONQueryRxFilter: Validate qemu reply prior parsing it

Usually, the flow in this area of the code is as follows:

qemuMonitorJSONMakeCommand()
qemuMonitorJSONCommand()
qemuMonitorJSONCheckError()
parseReply()

But in this function, for some reasons, the last two steps were
swapped. This makes no sense.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 f2b15794
......@@ -3401,14 +3401,14 @@ qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias,
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
goto cleanup;
if (qemuMonitorJSONQueryRxFilterParse(reply, filter) < 0)
goto cleanup;
ret = 0;
cleanup:
if (ret == 0)
ret = qemuMonitorJSONCheckError(cmd, reply);
if (ret < 0) {
virNetDevRxFilterFree(*filter);
*filter = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册