summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tor_runner.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/tor_runner.c b/src/tools/tor_runner.c
index dd90af3df5..4b21d7bf9b 100644
--- a/src/tools/tor_runner.c
+++ b/src/tools/tor_runner.c
@@ -86,9 +86,13 @@ child(const tor_main_configuration_t *cfg)
{
/* XXXX Close unused file descriptors. */
- char **args = real_calloc(cfg->argc+1, sizeof(char *));
+ char **args = real_calloc(cfg->argc + cfg->argc_owned+1, sizeof(char *));
memcpy(args, cfg->argv, cfg->argc * sizeof(char *));
- args[cfg->argc] = NULL;
+ if (cfg->argc_owned)
+ memcpy(args + cfg->argc, cfg->argv_owned,
+ cfg->argc_owned * sizeof(char *));
+
+ args[cfg->argc + cfg->argc_owned] = NULL;
int rv = execv(BINDIR "/tor", args);
@@ -98,4 +102,3 @@ child(const tor_main_configuration_t *cfg)
abort(); /* Unreachable */
}
}
-