diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-06-13 12:18:07 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-18 08:45:03 -0400 |
commit | c71809d403f1fe84105748583ef0f66b6c778db2 (patch) | |
tree | 09a2e934066e8cf80266fc56bde7aa76e49c30a8 /src/or/transports.c | |
parent | 133f380c87854af2ddd6f05f5d5f0cda197197b5 (diff) | |
download | tor-c71809d403f1fe84105748583ef0f66b6c778db2.tar.gz tor-c71809d403f1fe84105748583ef0f66b6c778db2.zip |
Insert the environment variable only if we have options to pass.
Diffstat (limited to 'src/or/transports.c')
-rw-r--r-- | src/or/transports.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/transports.c b/src/or/transports.c index 2b129cb0ff..39cb872c23 100644 --- a/src/or/transports.c +++ b/src/or/transports.c @@ -1134,7 +1134,9 @@ get_transport_options_for_server_proxy(const managed_proxy_t *mp) smartlist_free(options_tmp_sl); } SMARTLIST_FOREACH_END(transport); - options_string = smartlist_join_strings(string_sl, ";", 0, NULL); + if (smartlist_len(string_sl)) { + options_string = smartlist_join_strings(string_sl, ";", 0, NULL); + } SMARTLIST_FOREACH(string_sl, char *, t, tor_free(t)); smartlist_free(string_sl); @@ -1226,9 +1228,11 @@ create_managed_proxy_environment(const managed_proxy_t *mp) { char *server_transport_options = get_transport_options_for_server_proxy(mp); - smartlist_add_asprintf(envs, "TOR_PT_SERVER_TRANSPORT_OPTIONS=%s", - server_transport_options); - tor_free(server_transport_options); + if (server_transport_options) { + smartlist_add_asprintf(envs, "TOR_PT_SERVER_TRANSPORT_OPTIONS=%s", + server_transport_options); + tor_free(server_transport_options); + } } /* XXX024 Remove the '=' here once versions of obfsproxy which |