aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorTobias Blass <tobiasblass@t-online.de>2017-07-10 22:59:59 +0200
committerTobias Blass <tobiasblass@t-online.de>2017-07-10 22:59:59 +0200
commit566863ba5d2d09aebb74f90672fbee4d5754cf46 (patch)
treea77c67ad8ec937ce07faac2269c7e640b5bb8c9a /sway/commands
parent88120cfbbeaee8ee4ca49fc915eca209fa8cbb78 (diff)
downloadsway-566863ba5d2d09aebb74f90672fbee4d5754cf46.tar.xz
fix use-after-free bug
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index af5a01e5..d9ea37b7 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -61,10 +61,11 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) {
sym = ((char *)split->items[i])[strlen("button")] - '1' + M_LEFT_CLICK;
}
if (!sym) {
+ struct cmd_results *ret = cmd_results_new(CMD_INVALID, "bindsym",
+ "Unknown key '%s'", (char *)split->items[i]);
free_sway_binding(binding);
free_flat_list(split);
- return cmd_results_new(CMD_INVALID, "bindsym", "Unknown key '%s'",
- (char *)split->items[i]);
+ return ret;
}
xkb_keysym_t *key = malloc(sizeof(xkb_keysym_t));
if (!key) {