summaryrefslogtreecommitdiff
path: root/src/feature/nodelist/routerlist.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-08-30 23:33:01 +1000
committerteor <teor@torproject.org>2019-08-30 23:33:01 +1000
commita52a5e0099f9201e0dc1a358b1ac7721070caf56 (patch)
tree1d59f468697d72e6d2476d43127282d204284223 /src/feature/nodelist/routerlist.c
parent357e9a6f2c88b99e85e65c0401c524adbe921665 (diff)
parent1132dc9f75d7e5cbda1c5a6ac91d82c420967c0e (diff)
downloadtor-a52a5e0099f9201e0dc1a358b1ac7721070caf56.tar.gz
tor-a52a5e0099f9201e0dc1a358b1ac7721070caf56.zip
Merge branch 'maint-0.3.5' into maint-0.4.0
Diffstat (limited to 'src/feature/nodelist/routerlist.c')
-rw-r--r--src/feature/nodelist/routerlist.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index da3b673b69..b33dca67e3 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -954,20 +954,18 @@ routerlist_free_(routerlist_t *rl)
smartlist_free(rl->routers);
smartlist_free(rl->old_routers);
if (rl->desc_store.mmap) {
- int res = tor_munmap_file(routerlist->desc_store.mmap);
+ int res = tor_munmap_file(rl->desc_store.mmap);
if (res != 0) {
log_warn(LD_FS, "Failed to munmap routerlist->desc_store.mmap");
}
}
if (rl->extrainfo_store.mmap) {
- int res = tor_munmap_file(routerlist->extrainfo_store.mmap);
+ int res = tor_munmap_file(rl->extrainfo_store.mmap);
if (res != 0) {
log_warn(LD_FS, "Failed to munmap routerlist->extrainfo_store.mmap");
}
}
tor_free(rl);
-
- router_dir_info_changed();
}
/** Log information about how much memory is being used for routerlist,
@@ -1426,8 +1424,10 @@ routerlist_reparse_old(routerlist_t *rl, signed_descriptor_t *sd)
void
routerlist_free_all(void)
{
- routerlist_free(routerlist);
- routerlist = NULL;
+ routerlist_t *rl = routerlist;
+ routerlist = NULL; // Prevent internals of routerlist_free() from using
+ // routerlist.
+ routerlist_free(rl);
dirlist_free_all();
if (warned_nicknames) {
SMARTLIST_FOREACH(warned_nicknames, char *, cp, tor_free(cp));