aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/bar/modifier.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-07-01 23:12:17 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-07-02 08:03:41 +0900
commitc73c552cae435dd61ebbe0c76aa66570095375a9 (patch)
treed68569ddd573cd6fe8d4fcefae4fc3447322b1e6 /sway/commands/bar/modifier.c
parent6d2b82253a5f2fb0ab8e63ded2b62e5d4088e63b (diff)
bar_cmd_modifier: fix use-after-free on error
Found through static analysis.
Diffstat (limited to 'sway/commands/bar/modifier.c')
-rw-r--r--sway/commands/bar/modifier.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c
index 7ba4b125..02f845e6 100644
--- a/sway/commands/bar/modifier.c
+++ b/sway/commands/bar/modifier.c
@@ -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);