diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-04-09 18:24:55 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-04-09 18:24:55 +0000 |
commit | d3b6da8178e2f6dd841fa1c4d8ee0fbbd78a668c (patch) | |
tree | 5f522eccdce5d6170e817627648f96cf1d574075 | |
parent | 27ddacce624d7580a19e77fa8a6f0bd0db844eb4 (diff) | |
download | tor-d3b6da8178e2f6dd841fa1c4d8ee0fbbd78a668c.tar.gz tor-d3b6da8178e2f6dd841fa1c4d8ee0fbbd78a668c.zip |
r19269@catbus: nickm | 2008-04-09 14:24:36 -0400
Backport r14212: Free some static hashtables and the log mutex on exit.
svn:r14333
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/TODO.020 | 4 | ||||
-rw-r--r-- | src/common/tortls.c | 4 | ||||
-rw-r--r-- | src/or/main.c | 6 | ||||
-rw-r--r-- | src/or/policies.c | 4 |
5 files changed, 16 insertions, 4 deletions
@@ -13,6 +13,8 @@ Changes in version 0.2.0.24-rc - 2008-04-0? Bugfix on 0.2.0.16-alpha. - Free authority certificates on exit, so they don't look like memory leaks. Bugfix on 0.2.0.19-alpha. + - Free static hashtables for policy maps and for TLS connections on + shutdown, so they don't look like memory leaks. Bugfix on 0.2.0.x. Changes in version 0.2.0.23-rc - 2008-03-24 diff --git a/doc/TODO.020 b/doc/TODO.020 index 1e9f03ca0f..7b7ff430a4 100644 --- a/doc/TODO.020 +++ b/doc/TODO.020 @@ -5,8 +5,8 @@ description of the patch.) Backport items for 0.2.0: o r14204: start policy refcounts at 1, not 2. o r14205: free authority certs on exit. - - r14212: free static hashtables and log mutex on exit. - - r14214: don't read torrc when all we + o r14212: free static hashtables and log mutex on exit. + - r14214: don't read torrc when all we do is --hash-password - r14329: update last_added_nonpadding for relay cells. Backport for 0.2.0 once better tested: diff --git a/src/common/tortls.c b/src/common/tortls.c index 7ad1507218..708e4c0f79 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -314,6 +314,10 @@ tor_tls_free_all(void) tor_tls_context_decref(global_tls_context); global_tls_context = NULL; } + if (!HT_EMPTY(&tlsmap_root)) { + log_warn(LD_MM, "Still have entries in the tlsmap at shutdown."); + } + HT_CLEAR(tlsmap, &tlsmap_root); } /** We need to give OpenSSL a callback to verify certificates. This is diff --git a/src/or/main.c b/src/or/main.c index 2ebd08b947..8357124297 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1849,13 +1849,15 @@ tor_free_all(int postfork) entry_guards_free_all(); connection_free_all(); buf_shrink_freelists(1); - policies_free_all(); if (!postfork) { config_free_all(); router_free_all(); + policies_free_all(); } free_cell_pool(); - tor_tls_free_all(); + if (!postfork) { + tor_tls_free_all(); + } /* stuff in main.c */ smartlist_free(connection_array); smartlist_free(closeable_connection_lst); diff --git a/src/or/policies.c b/src/or/policies.c index b7bddc6fd8..e28ba3cb48 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -922,5 +922,9 @@ policies_free_all(void) authdir_reject_policy = NULL; addr_policy_list_free(authdir_invalid_policy); authdir_invalid_policy = NULL; + + if (!HT_EMPTY(&policy_root)) + log_warn(LD_MM, "Still had some address policies cached at shutdown."); + HT_CLEAR(policy_map, &policy_root); } |