diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-09-30 21:38:57 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-09-30 21:38:57 +0000 |
commit | 9e54e2e2931a4c86ff13b70a8a04024f83cd67a2 (patch) | |
tree | b5d383f37f23e2b25c540f9929e85c1ed8084932 /src/or/circuitbuild.c | |
parent | 808e584a875e12ee084b49636283a1a24fce5f91 (diff) | |
download | tor-9e54e2e2931a4c86ff13b70a8a04024f83cd67a2.tar.gz tor-9e54e2e2931a4c86ff13b70a8a04024f83cd67a2.zip |
free helper node status info on shutdown
svn:r5177
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index d488fbe127..57a2d86f84 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1672,6 +1672,16 @@ clear_helper_nodes(void) helper_nodes_changed(); } +/** Release all storage held by the list of helper nodes */ +void +helper_nodes_free_all(void) +{ + /* Don't call clear_helper_nodes(); that will flush our state change to disk */ + 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? */ #define HELPER_ALLOW_DOWNTIME 48*60*60 @@ -1899,6 +1909,7 @@ helper_nodes_parse_state(or_state_t *state, int set, const char **err) if (*err || !set) { SMARTLIST_FOREACH(helpers, helper_node_t *, h, tor_free(h)); smartlist_free(helpers); + helpers = NULL; } if (!*err && set) { if (helper_nodes) { |