diff options
Diffstat (limited to 'src/command.c')
| -rw-r--r-- | src/command.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c index 20b00b1..3d63121 100644 --- a/src/command.c +++ b/src/command.c @@ -119,7 +119,15 @@ pid_t execute_command(command *cmd) { close(cmd->pipe[1]); } - execvp(cmd->command, cmd->args); + /* + * NOTE: discarding the const qualifier here is okay because either + * 1) exec fails, in which case the process is aborted immediately + * 2) exec succeeds, in which case the memory is released immediately + * + * In either case, the args won't be accessed again. + */ + execvp(cmd->command, (char**)cmd->args); + perror("Could not run command"); exit(EXIT_FAILURE); } else if (res < 0) { |