diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2016-04-29 11:25:26 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2016-04-29 11:25:26 -0400 |
| commit | a22d9d2873072ad687a3444942bb34bab9feb43d (patch) | |
| tree | 1ae07eea97645a40fcd54ef6d62ea32f7781b5f5 | |
| parent | 708dd7b9e036681c267befb3aba0a03b23c465a1 (diff) | |
| parent | 3f9a761c6e723d8e1bef09e29092e887ba159770 (diff) | |
Merge pull request #614 from neosilky/memleak
sway/commands.c: add some free calls to release allocated memory
| -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) { argv++; argc--; } else { + free_sway_binding(binding); return cmd_results_new(CMD_FAILURE, "bindsym", "Invalid bindsym command" "(expected more than 2 arguments, got %d)", argc); @@ -310,6 +311,7 @@ static struct cmd_results *cmd_bindcode(int argc, char **argv) { argv++; argc--; } else { + free_sway_binding(binding); return cmd_results_new(CMD_FAILURE, "bindcode", "Invalid bindcode command" "(expected more than 2 arguments, got %d)", argc); @@ -531,6 +533,7 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) { close(fd[1]); _exit(0); // Close child process } else if (pid < 0) { + free(child); return cmd_results_new(CMD_FAILURE, "exec_always", "Command failed (sway could not fork)."); } close(fd[1]); // close write |
