aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2019-02-22 08:20:26 +0000
committerGitHub <noreply@github.com>2019-02-22 08:20:26 +0000
commit923cd865f5817a64ee5e882ebcc2c9190371ef9d (patch)
tree8232fc01222e0214e8eac0425f3fe7c30973bd35
parent7252ca09a7ccd09673a2903509cde6dcb077bfb7 (diff)
parentaa4ccd845cf93ac2117b12083fed748f4c01e744 (diff)
downloadsway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.zip
sway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.tar.gz
sway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.tar.bz2
Merge pull request #3740 from Emantor/fix/ipc_allocs
Fix small memory leaks reported in #3658
-rw-r--r--sway/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index b118a18..6754190 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -126,6 +126,7 @@ void run_as_ipc_client(char *command, char *socket_path) {
uint32_t len = strlen(command);
char *resp = ipc_single_command(socketfd, IPC_COMMAND, command, &len);
printf("%s\n", resp);
+ free(resp);
close(socketfd);
}
@@ -347,6 +348,7 @@ int main(int argc, char **argv) {
}
char *command = join_args(argv + optind, argc - optind);
run_as_ipc_client(command, socket_path);
+ free(command);
return 0;
}