diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-07 15:13:21 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-07 15:13:21 -0500 |
commit | 0061d428900946ce8bf5c8bfb4c2b3b5faa4f691 (patch) | |
tree | c6144a9274651d859cf2166567c4f31923f3d82e /src/or/dirvote.c | |
parent | ad28397bbf1744993538fa96675a55bba59f2b57 (diff) | |
parent | f272ee6a20ec0df491bed485a0eea4ae2f82e40c (diff) | |
download | tor-0061d428900946ce8bf5c8bfb4c2b3b5faa4f691.tar.gz tor-0061d428900946ce8bf5c8bfb4c2b3b5faa4f691.zip |
Merge remote-tracking branch 'public/bug7816_024'
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 43b9f5eb12..469c86c7c5 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -2144,7 +2144,7 @@ networkstatus_compute_consensus(smartlist_t *votes, digest, digest_len, legacy_signing_key)) { log_warn(LD_BUG, "Couldn't sign consensus networkstatus."); - return NULL; /* This leaks, but it should never happen. */ + goto done; } smartlist_add(chunks, tor_strdup(sigbuf)); } @@ -2152,13 +2152,6 @@ networkstatus_compute_consensus(smartlist_t *votes, result = smartlist_join_strings(chunks, "", 0, NULL); - tor_free(client_versions); - tor_free(server_versions); - SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); - smartlist_free(flags); - SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); - smartlist_free(chunks); - { networkstatus_t *c; if (!(c = networkstatus_parse_vote_from_string(result, NULL, @@ -2166,7 +2159,7 @@ networkstatus_compute_consensus(smartlist_t *votes, log_err(LD_BUG, "Generated a networkstatus consensus we couldn't " "parse."); tor_free(result); - return NULL; + goto done; } // Verify balancing parameters if (consensus_method >= MIN_METHOD_FOR_BW_WEIGHTS && added_weights) { @@ -2175,6 +2168,15 @@ networkstatus_compute_consensus(smartlist_t *votes, networkstatus_vote_free(c); } + done: + + tor_free(client_versions); + tor_free(server_versions); + SMARTLIST_FOREACH(flags, char *, cp, tor_free(cp)); + smartlist_free(flags); + SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); + smartlist_free(chunks); + return result; } |