]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
no more memory leaks
authorRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 04:18:26 +0000 (04:18 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 04:18:26 +0000 (04:18 +0000)
when you run it under normal operation
for as many as three minutes

svn:r622

src/or/routers.c

index f04fd24ed291d5bcd3a2ad6445a4fa4d9b114dca..4ecd2fcb9c543e8e787bef39bbbc0078decb7d76 100644 (file)
@@ -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;