From 3d31771da9fcd0be5db21ac19a34d978bfe6d78d Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 3 Oct 2012 12:46:09 -0400 Subject: [PATCH] Free some more still-in-use memory at exit --- changes/bug7029 | 3 +++ src/or/circuitbuild.c | 1 + src/or/config.c | 3 +++ src/or/connection.c | 3 +++ src/or/main.c | 4 ++++ src/or/rephist.c | 2 ++ 6 files changed, 16 insertions(+) create mode 100644 changes/bug7029 diff --git a/changes/bug7029 b/changes/bug7029 new file mode 100644 index 0000000000..a115b42f8e --- /dev/null +++ b/changes/bug7029 @@ -0,0 +1,3 @@ + o Minor bugfixes (code cleanliness): + - Free some more still-in-use memory at exit, to make hunting for + memory leaks easier. Resolves bug 7029. diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 09eef64eff..48cc8b7152 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -5865,5 +5865,6 @@ entry_guards_free_all(void) clear_bridge_list(); smartlist_free(bridge_list); bridge_list = NULL; + circuit_build_times_free_timeouts(&circ_times); } diff --git a/src/or/config.c b/src/or/config.c index c04f2aa022..4900506500 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -673,6 +673,9 @@ config_free_all(void) tor_free(torrc_defaults_fname); tor_free(the_tor_version); tor_free(global_dirfrontpagecontents); + + tor_free(the_short_tor_version); + tor_free(the_tor_version); } /** Make address -- a piece of information related to our operation as diff --git a/src/or/connection.c b/src/or/connection.c index d64c676bfb..ec39f54740 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -4289,6 +4289,9 @@ connection_free_all(void) outgoing_addrs = NULL; } + tor_free(last_interface_ipv4); + tor_free(last_interface_ipv6); + #ifdef USE_BUFFEREVENTS if (global_rate_limit) bufferevent_rate_limit_group_free(global_rate_limit); diff --git a/src/or/main.c b/src/or/main.c index 74bb696725..ea08faa338 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2477,6 +2477,10 @@ tor_free_all(int postfork) smartlist_free(closeable_connection_lst); smartlist_free(active_linked_connection_lst); periodic_timer_free(second_timer); +#ifndef USE_BUFFEREVENTS + periodic_timer_free(refill_timer); +#endif + if (!postfork) { release_lockfile(); } diff --git a/src/or/rephist.c b/src/or/rephist.c index f9c0b5bebb..b9e7be1fca 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -3003,6 +3003,8 @@ rep_hist_free_all(void) digestmap_free(history_map, free_or_history); tor_free(read_array); tor_free(write_array); + tor_free(dir_read_array); + tor_free(dir_write_array); tor_free(last_stability_doc); tor_free(exit_bytes_read); tor_free(exit_bytes_written);