diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-20 12:17:31 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-20 12:19:22 +0000 |
| commit | 42ec2640753650c69385d86c2fbb386d23965c89 (patch) | |
| tree | b1397db5e2128d97d340260f732bf4b4edce9a1e /slave.c | |
| parent | config: remove duplicated error logs for invalid colors (diff) | |
tokenize: strdup() each individual argv
Instead of referencing the un-tokenized “raw” command string, strdup()
each argv. This way, the input string can be ‘const’.
Diffstat (limited to 'slave.c')
| -rw-r--r-- | slave.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -293,9 +293,7 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv, char **shell_argv = NULL; if (argc == 0) { - char *shell_copy = xstrdup(conf_shell); - if (!tokenize_cmdline(shell_copy, &_shell_argv)) { - free(shell_copy); + if (!tokenize_cmdline(conf_shell, &_shell_argv)) { (void)!write(fork_pipe[1], &errno, sizeof(errno)); _exit(0); } |
