aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2019-02-22 08:20:26 +0000
committerLibravatar GitHub <noreply@github.com>2019-02-22 08:20:26 +0000
commit923cd865f5817a64ee5e882ebcc2c9190371ef9d (patch)
tree8232fc01222e0214e8eac0425f3fe7c30973bd35
parentmove scratchpad: hide visible scratchpad container (diff)
parentrun_as_ipc_client: free response after running the IPC command (diff)
downloadsway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.tar.gz
sway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.tar.zst
sway-923cd865f5817a64ee5e882ebcc2c9190371ef9d.zip
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 b118a182..6754190f 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -126,6 +126,7 @@ void run_as_ipc_client(char *command, char *socket_path) {
126 uint32_t len = strlen(command); 126 uint32_t len = strlen(command);
127 char *resp = ipc_single_command(socketfd, IPC_COMMAND, command, &len); 127 char *resp = ipc_single_command(socketfd, IPC_COMMAND, command, &len);
128 printf("%s\n", resp); 128 printf("%s\n", resp);
129 free(resp);
129 close(socketfd); 130 close(socketfd);
130} 131}
131 132
@@ -347,6 +348,7 @@ int main(int argc, char **argv) {
347 } 348 }
348 char *command = join_args(argv + optind, argc - optind); 349 char *command = join_args(argv + optind, argc - optind);
349 run_as_ipc_client(command, socket_path); 350 run_as_ipc_client(command, socket_path);
351 free(command);
350 return 0; 352 return 0;
351 } 353 }
352 354