aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-08-22 03:03:24 +0000
committerRoger Dingledine <arma@torproject.org>2007-08-22 03:03:24 +0000
commit79066b48511ee48cc10edfcbd5d0a8ed29e6de23 (patch)
treeca686db06927bf2b88ede5f188a948af9952188c /src
parenta80dd635b3fb196192a292caa33575ea098e6599 (diff)
downloadtor-79066b48511ee48cc10edfcbd5d0a8ed29e6de23.tar.gz
tor-79066b48511ee48cc10edfcbd5d0a8ed29e6de23.zip
backport candidate:
Fix a minor memory leak when we fail to find enough suitable servers to choose a circuit. Bugfix on 0.1.2.x. svn:r11247
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 7dcbf71d29..a8cc40861c 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1072,7 +1072,6 @@ circuit_get_unhandled_ports(time_t now)
int i;
for (i = 0; i < smartlist_len(source); ++i) {
- /*XXXX020 some of these are leaked somewhere.. fix that. */
tmp = tor_malloc(sizeof(uint16_t));
memcpy(tmp, smartlist_get(source, i), sizeof(uint16_t));
smartlist_add(dest, tmp);
@@ -1272,7 +1271,7 @@ choose_good_exit_server_general(routerlist_t *dir, int need_uptime,
* at least one predicted exit port. */
int try;
- smartlist_t *needed_ports = circuit_get_unhandled_ports(time(NULL));
+ smartlist_t *needed_ports;
if (best_support == -1) {
if (need_uptime || need_capacity) {
@@ -1290,6 +1289,7 @@ choose_good_exit_server_general(routerlist_t *dir, int need_uptime,
log_notice(LD_CIRC, "All routers are down or won't exit -- choosing a "
"doomed exit at random.");
}
+ needed_ports = circuit_get_unhandled_ports(time(NULL));
for (try = 0; try < 2; try++) {
/* try once to pick only from routers that satisfy a needed port,
* then if there are none, pick from any that support exiting. */