aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/routerlist.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-07-24 12:32:06 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2019-07-24 12:32:06 +0300
commit2944b091fcd0d614f39e89eb22a8f943ff77dc71 (patch)
treee1aba7889472f4e496740bed02d9796584eada50 /src/feature/nodelist/routerlist.c
parent91f04d006bb850736df587e2942fedcc26d3dca9 (diff)
parentbb33a2f290561f96a2ab980f295e9bafcde39707 (diff)
downloadtor-2944b091fcd0d614f39e89eb22a8f943ff77dc71.tar.gz
tor-2944b091fcd0d614f39e89eb22a8f943ff77dc71.zip
Merge branch 'maint-0.4.1'
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 5948445c96..709ceff53a 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));