aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 04:18:26 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 04:18:26 +0000
commita73a3a21f78498a73b91c5813a7eb58dc62c8ae2 (patch)
treed8321db2c3d37512627c296cca987d0b1625011a
parenta3962bf6fc449cfa852d4bdc5e406244a91d2064 (diff)
downloadtor-a73a3a21f78498a73b91c5813a7eb58dc62c8ae2.tar.gz
tor-a73a3a21f78498a73b91c5813a7eb58dc62c8ae2.zip
no more memory leaks
when you run it under normal operation for as many as three minutes svn:r622
-rw-r--r--src/or/routers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/routers.c b/src/or/routers.c
index f04fd24ed2..4ecd2fcb9c 100644
--- a/src/or/routers.c
+++ b/src/or/routers.c
@@ -746,11 +746,12 @@ router_resolve_directory(directory_t *dir)
log_fn(LOG_WARN, "Couldn't resolve router %s; removing",
dir->routers[i]->address);
remove = 1;
- routerinfo_free(dir->routers[i]);
- } else if (options.Nickname && !strcmp(dir->routers[i]->nickname, options.Nickname)) {
+ } else if (options.Nickname &&
+ !strcmp(dir->routers[i]->nickname, options.Nickname)) {
remove = 1;
}
if (remove) {
+ routerinfo_free(dir->routers[i]);
dir->routers[i] = dir->routers[--max];
--dir->n_routers;
--i;