diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 64cd0dc8..332d3888 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -245,6 +245,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) { | |||
245 | argv++; | 245 | argv++; |
246 | argc--; | 246 | argc--; |
247 | } else { | 247 | } else { |
248 | free_sway_binding(binding); | ||
248 | return cmd_results_new(CMD_FAILURE, "bindsym", | 249 | return cmd_results_new(CMD_FAILURE, "bindsym", |
249 | "Invalid bindsym command" | 250 | "Invalid bindsym command" |
250 | "(expected more than 2 arguments, got %d)", argc); | 251 | "(expected more than 2 arguments, got %d)", argc); |
@@ -310,6 +311,7 @@ static struct cmd_results *cmd_bindcode(int argc, char **argv) { | |||
310 | argv++; | 311 | argv++; |
311 | argc--; | 312 | argc--; |
312 | } else { | 313 | } else { |
314 | free_sway_binding(binding); | ||
313 | return cmd_results_new(CMD_FAILURE, "bindcode", | 315 | return cmd_results_new(CMD_FAILURE, "bindcode", |
314 | "Invalid bindcode command" | 316 | "Invalid bindcode command" |
315 | "(expected more than 2 arguments, got %d)", argc); | 317 | "(expected more than 2 arguments, got %d)", argc); |
@@ -531,6 +533,7 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
531 | close(fd[1]); | 533 | close(fd[1]); |
532 | _exit(0); // Close child process | 534 | _exit(0); // Close child process |
533 | } else if (pid < 0) { | 535 | } else if (pid < 0) { |
536 | free(child); | ||
534 | return cmd_results_new(CMD_FAILURE, "exec_always", "Command failed (sway could not fork)."); | 537 | return cmd_results_new(CMD_FAILURE, "exec_always", "Command failed (sway could not fork)."); |
535 | } | 538 | } |
536 | close(fd[1]); // close write | 539 | close(fd[1]); // close write |