bar_cmd_modifier: fix use-after-free on error

Found through static analysis.
master
Dominique Martinet 7 years ago
parent 6d2b82253a
commit c73c552cae

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

Loading…
Cancel
Save