mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 13:04:11 +01:00
Merge pull request #3740 from Emantor/fix/ipc_allocs
Fix small memory leaks reported in #3658
This commit is contained in:
commit
923cd865f5
@ -126,6 +126,7 @@ void run_as_ipc_client(char *command, char *socket_path) {
|
|||||||
uint32_t len = strlen(command);
|
uint32_t len = strlen(command);
|
||||||
char *resp = ipc_single_command(socketfd, IPC_COMMAND, command, &len);
|
char *resp = ipc_single_command(socketfd, IPC_COMMAND, command, &len);
|
||||||
printf("%s\n", resp);
|
printf("%s\n", resp);
|
||||||
|
free(resp);
|
||||||
close(socketfd);
|
close(socketfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,6 +348,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
char *command = join_args(argv + optind, argc - optind);
|
char *command = join_args(argv + optind, argc - optind);
|
||||||
run_as_ipc_client(command, socket_path);
|
run_as_ipc_client(command, socket_path);
|
||||||
|
free(command);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user