Monitor *mon = cur_mon;
const char *cmd_name, *info_item;
- args = NULL;
+ args = input = NULL;
obj = json_parser_parse(tokens, NULL);
if (!obj) {
cmd_name = qdict_get_str(input, "execute");
if (invalid_qmp_mode(mon, cmd_name)) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_input;
+ goto err_out;
}
/*
*/
if (compare_cmd(cmd_name, "info")) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_input;
+ goto err_out;
} else if (strstart(cmd_name, "query-", &info_item)) {
cmd = monitor_find_command("info");
qdict_put_obj(input, "arguments",
cmd = monitor_find_command(cmd_name);
if (!cmd || !monitor_handler_ported(cmd)) {
qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
- goto err_input;
+ goto err_out;
}
}
QINCREF(args);
}
- QDECREF(input);
-
err = qmp_check_client_args(cmd, args);
if (err < 0) {
goto err_out;
} else {
monitor_call_handler(mon, cmd, args);
}
+
goto out;
-err_input:
- QDECREF(input);
err_out:
monitor_protocol_emitter(mon, NULL);
out:
+ QDECREF(input);
QDECREF(args);
}