bar_cmd_modifier: fix use-after-free on error

Found through static analysis.
This commit is contained in:
Dominique Martinet 2018-07-01 23:12:17 +09:00
parent 6d2b82253a
commit c73c552cae

View File

@ -22,9 +22,10 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
mod |= tmp_mod; mod |= tmp_mod;
continue; continue;
} else { } else {
error = cmd_results_new(CMD_INVALID, "modifier",
"Unknown modifier '%s'", split->items[i]);
free_flat_list(split); free_flat_list(split);
return cmd_results_new(CMD_INVALID, "modifier", return error;
"Unknown modifier '%s'", split->items[i]);
} }
} }
free_flat_list(split); free_flat_list(split);