From a1ab2c80871739d2f550d5912cea372375afa221 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 17 Jul 2007 11:33:38 +0000 Subject: free bridge list on exit; try harder to free buffer freelists on exit. svn:r10854 --- src/or/circuitbuild.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/or/circuitbuild.c') diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index c0c5965a34..4d9a9c23ac 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2083,17 +2083,6 @@ pick_entry_guards(void) entry_guards_changed(); } -/** Release all storage held by the list of entry guards. */ -void -entry_guards_free_all(void) -{ - if (entry_guards) { - SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e, tor_free(e)); - smartlist_free(entry_guards); - entry_guards = NULL; - } -} - /** How long (in seconds) do we allow an entry guard to be nonfunctional, * unlisted, excluded, or otherwise nonusable before we give up on it? */ #define ENTRY_GUARD_REMOVE_AFTER (30*24*60*60) @@ -2823,3 +2812,18 @@ any_bridge_descriptors_known(void) #endif } +/** Release all storage held by the list of entry guards and related + * memory structs. */ +void +entry_guards_free_all(void) +{ + if (entry_guards) { + SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e, tor_free(e)); + smartlist_free(entry_guards); + entry_guards = NULL; + } + clear_bridge_list(); + smartlist_free(bridge_list); + bridge_list = NULL; +} + -- cgit v1.2.3-54-g00ecf