From: Nick Mathewson Date: Mon, 16 Jan 2012 20:16:41 +0000 (-0500) Subject: Merge remote-tracking branch 'asn-mytor/bug4751' X-Git-Tag: tor-0.2.3.11-alpha~13 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=47aa491f9fbae38f71f96f50c4aec3f871c8419d;p=thirdparty%2Ftor.git Merge remote-tracking branch 'asn-mytor/bug4751' --- 47aa491f9fbae38f71f96f50c4aec3f871c8419d diff --cc src/or/transports.c index d8d2ff6aa6,06c91452c6..43e978a7c1 --- a/src/or/transports.c +++ b/src/or/transports.c @@@ -912,22 -912,24 +912,23 @@@ parse_cmethod_line(const char *line, ma return r; } - /** Return a string containing the address:port that transport - * should use. It's the responsibility of the caller to free() the - * received string. */ + /** Return the string that tor should place in TOR_PT_SERVER_BINDADDR + * while configuring the server managed proxy in mp. The + * string is stored in the heap, and it's the the responsibility of + * the caller to deallocate it after its use. */ static char * - get_bindaddr_for_proxy(const managed_proxy_t *mp) + get_bindaddr_for_server_proxy(const managed_proxy_t *mp) { - char *bindaddr = NULL; + char *bindaddr_result = NULL; char *bindaddr_tmp = NULL; smartlist_t *string_tmp = smartlist_create(); tor_assert(mp->is_server); SMARTLIST_FOREACH_BEGIN(mp->transports_to_launch, char *, t) { - bindaddr_tmp = get_bindaddr_for_transport(t); + bindaddr_tmp = get_stored_bindaddr_for_server_transport(t); - tor_asprintf(&bindaddr, "%s-%s", t, bindaddr_tmp); - smartlist_add(string_tmp, bindaddr); + smartlist_add_asprintf(string_tmp, "%s-%s", t, bindaddr_tmp); tor_free(bindaddr_tmp); } SMARTLIST_FOREACH_END(t);