[or-cvs] [tor/master 4/7] Fix a memory leak in dirvote_compute_consensuses()
nickm at torproject.org
nickm at torproject.org
Mon Aug 16 03:43:14 UTC 2010
Author: Sebastian Hahn <sebastian at torproject.org>
Date: Sun, 15 Aug 2010 21:02:01 +0200
Subject: Fix a memory leak in dirvote_compute_consensuses()
Commit: b2dcff5766cdf33799659e667a06e109d17b6eb9
---
changes/bug1831 | 3 +++
src/or/dirvote.c | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/changes/bug1831 b/changes/bug1831
index 6c504da..72f7d21 100644
--- a/changes/bug1831
+++ b/changes/bug1831
@@ -3,3 +3,6 @@
Bugfix on 0.2.2.14-alpha; fixes bug 1831 partially.
- Fix a memory leak in dirvote_add_signatures_to_pending_consensus().
Bugfix on 0.2.2.6-alpha; fixes bug 1831 partially.
+ - Fix a memory leak in dirvote_compute_consensuses().
+ Bugfix on 0.2.0.3-alpha; fixes bug 1831 partially.
+
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 0042934..925f57f 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2942,6 +2942,7 @@ dirvote_compute_consensuses(void)
strlen(pending_consensus_signatures), 0);
log_notice(LD_DIR, "Signature(s) posted.");
+ smartlist_free(votes);
return 0;
err:
smartlist_free(votes);
@@ -3138,7 +3139,7 @@ void
dirvote_free_all(void)
{
dirvote_clear_votes(1);
- /* now empty as a result of clear_pending_votes. */
+ /* now empty as a result of dirvote_clear_votes(). */
smartlist_free(pending_vote_list);
pending_vote_list = NULL;
smartlist_free(previous_vote_list);
@@ -3147,7 +3148,7 @@ dirvote_free_all(void)
dirvote_clear_pending_consensuses();
tor_free(pending_consensus_signatures);
if (pending_consensus_signature_list) {
- /* now empty as a result of clear_pending_votes. */
+ /* now empty as a result of dirvote_clear_votes(). */
smartlist_free(pending_consensus_signature_list);
pending_consensus_signature_list = NULL;
}
--
1.7.1
More information about the tor-commits
mailing list