r19269@catbus: nickm | 2008-04-09 14:24:36 -0400

Backport r14212: Free some static hashtables and the log mutex on exit.


svn:r14333
This commit is contained in:
Nick Mathewson 2008-04-09 18:24:55 +00:00
parent 27ddacce62
commit d3b6da8178
5 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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);

View File

@ -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);
}