mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 07:56:31 +01:00
bar_cmd_modifier: fix use-after-free on error
Found through static analysis.
This commit is contained in:
parent
6d2b82253a
commit
c73c552cae
1 changed files with 3 additions and 2 deletions
|
@ -22,9 +22,10 @@ struct cmd_results *bar_cmd_modifier(int argc, char **argv) {
|
|||
mod |= tmp_mod;
|
||||
continue;
|
||||
} else {
|
||||
error = cmd_results_new(CMD_INVALID, "modifier",
|
||||
"Unknown modifier '%s'", split->items[i]);
|
||||
free_flat_list(split);
|
||||
return cmd_results_new(CMD_INVALID, "modifier",
|
||||
"Unknown modifier '%s'", split->items[i]);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
free_flat_list(split);
|
||||
|
|
Loading…
Reference in a new issue