Commit d91d9bf6 authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Blue Swirl
Browse files

monitor: Remove uneeded goto



The 'found' goto in monitor_handle_command() can be dropped if we check
for 'cmd->name' after looking up for the command to execute.

Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent 3a41759d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2432,11 +2432,13 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline)
    /* find the command */
    for(cmd = mon_cmds; cmd->name != NULL; cmd++) {
        if (compare_cmd(cmdname, cmd->name))
            goto found;
            break;
    }

    if (cmd->name == NULL) {
        monitor_printf(mon, "unknown command: '%s'\n", cmdname);
        return;
 found:
    }

    for(i = 0; i < MAX_ARGS; i++)
        str_allocated[i] = NULL;