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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-05-03 10:44:13 +02:00
parent f2b157945f
commit 3af8186898

View File

@ -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;