Make --hash-password not craash on exit.

svn:r5243
This commit is contained in:
Nick Mathewson 2005-10-12 19:08:48 +00:00
parent 9a1d204318
commit 905ef987e2
3 changed files with 25 additions and 10 deletions

View File

@ -1677,10 +1677,12 @@ void
helper_nodes_free_all(void)
{
/* Don't call clear_helper_nodes(); that will flush our state change to disk */
if (helper_nodes) {
SMARTLIST_FOREACH(helper_nodes, helper_node_t *, h, tor_free(h));
smartlist_free(helper_nodes);
helper_nodes = NULL;
}
}
/** How long (in seconds) do we allow a helper node to be nonfunctional before
* we give up on it? */

View File

@ -394,12 +394,20 @@ set_options(or_options_t *new_val)
void
config_free_all(void)
{
if (global_options) {
config_free(&options_format, global_options);
global_options = NULL;
}
if (global_state) {
config_free(&state_format, global_state);
global_state = NULL;
}
tor_free(torrc_fname);
if (reachable_addr_policy) {
addr_policy_free(reachable_addr_policy);
reachable_addr_policy = NULL;
}
}
/** If options->SafeLogging is on, return a not very useful string,
* else return address.

View File

@ -556,9 +556,14 @@ addressmap_clean(time_t now)
void
addressmap_free_all(void)
{
if (addressmap) {
strmap_free(addressmap, addressmap_ent_free);
addressmap = NULL;
}
if (virtaddress_reversemap) {
strmap_free(virtaddress_reversemap, addressmap_virtaddress_ent_free);
virtaddress_reversemap = NULL;
}
}
/** Look at address, and rewrite it until it doesn't want any