diff options
author | David Goulet <dgoulet@torproject.org> | 2018-04-25 10:09:50 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-04-27 11:40:44 -0400 |
commit | d7e4706f2293cb199d3246197b2d911188de0e45 (patch) | |
tree | a02734340ac3c98b541c5d43ef5dc169b0d17814 /src/or/networkstatus.c | |
parent | 35ff2a3b864d921d45aec50f551b59f24e31a512 (diff) | |
download | tor-d7e4706f2293cb199d3246197b2d911188de0e45.tar.gz tor-d7e4706f2293cb199d3246197b2d911188de0e45.zip |
ns: Move ns_detached_signatures_free() to networkstatus.c
From dirvote.c to networkstatus.c where it makes more sense both in terms of
namespace and subsystem responsability.
This removes one less dependency on the dirauth module.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index f78d9d672b..fa8d0bcf13 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -2642,6 +2642,25 @@ networkstatus_check_required_protocols(const networkstatus_t *ns, return 0; } +/** Release all storage held in <b>s</b>. */ +void +ns_detached_signatures_free_(ns_detached_signatures_t *s) +{ + if (!s) + return; + if (s->signatures) { + STRMAP_FOREACH(s->signatures, flavor, smartlist_t *, sigs) { + SMARTLIST_FOREACH(sigs, document_signature_t *, sig, + document_signature_free(sig)); + smartlist_free(sigs); + } STRMAP_FOREACH_END; + strmap_free(s->signatures, NULL); + strmap_free(s->digests, tor_free_); + } + + tor_free(s); +} + /** Free all storage held locally in this module. */ void networkstatus_free_all(void) |