diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-04 11:04:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-04 11:04:21 -0400 |
commit | 3507fead10ef4f990c0373f4405bd235c0f0b35c (patch) | |
tree | 2eda3631bd503be2731f320f8ca46d60d2b86a16 /src/tools/tor_runner.c | |
parent | 94b04d6c64ec998a9117d65a156888fa3af188e5 (diff) | |
parent | 820aba70efcc6f50f23cf676832412852a01141a (diff) | |
download | tor-3507fead10ef4f990c0373f4405bd235c0f0b35c.tar.gz tor-3507fead10ef4f990c0373f4405bd235c0f0b35c.zip |
Merge branch 'tor_api_owning_control'
Diffstat (limited to 'src/tools/tor_runner.c')
-rw-r--r-- | src/tools/tor_runner.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/tor_runner.c b/src/tools/tor_runner.c index f8805e6500..b07b72a095 100644 --- a/src/tools/tor_runner.c +++ b/src/tools/tor_runner.c @@ -92,9 +92,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); |