diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-25 22:56:50 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-25 22:56:50 +0000 |
commit | 47f3a40900e24cf5d14e8fa218b876a2b39b25f0 (patch) | |
tree | a7445e907c56cfe6a443b34c670556f7e3a9f2ba /src/or/dirvote.c | |
parent | 2305c2c7be1d2101d2f666ee88054aa55ab3e348 (diff) | |
download | tor-47f3a40900e24cf5d14e8fa218b876a2b39b25f0.tar.gz tor-47f3a40900e24cf5d14e8fa218b876a2b39b25f0.zip |
r13904@catbus: nickm | 2007-07-25 18:04:46 -0400
Fix whitespaces and compilation in and around dirvote code.
svn:r10929
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 9c1b90a2e2..06c90f80f9 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -885,8 +885,7 @@ dirvote_perform_vote(void) pending_vote_t *pending_vote; const char *msg = ""; - if ((pending_vote = dirvote_add_vote(tor_memdup(new_vote->dir, - new_vote->dir_len), &msg))) { + if ((pending_vote = dirvote_add_vote(new_vote->dir, &msg))) { log_warn(LD_DIR, "Couldn't store my own vote! (I told myself, '%s'.)", msg); return; @@ -916,7 +915,7 @@ dirvote_clear_pending_votes(void) /** DOCDOC */ pending_vote_t * -dirvote_add_vote(char *vote_body, const char **msg_out) +dirvote_add_vote(const char *vote_body, const char **msg_out) { networkstatus_vote_t *vote; networkstatus_voter_info_t *vi; @@ -952,7 +951,8 @@ dirvote_add_vote(char *vote_body, const char **msg_out) if (v->vote->published < vote->published) { cached_dir_decref(v->vote_body); networkstatus_vote_free(v->vote); - v->vote_body = new_cached_dir(vote_body, vote->published); + v->vote_body = new_cached_dir(tor_strdup(vote_body), + vote->published); v->vote = vote; *msg_out = "ok"; return v; @@ -964,14 +964,14 @@ dirvote_add_vote(char *vote_body, const char **msg_out) }); pending_vote = tor_malloc_zero(sizeof(pending_vote_t)); - pending_vote->vote_body = new_cached_dir(vote_body, vote->published); + pending_vote->vote_body = new_cached_dir(tor_strdup(vote_body), + vote->published); pending_vote->vote = vote; smartlist_add(pending_vote_list, pending_vote); *msg_out = "ok"; return pending_vote; err: - tor_free(vote_body); if (vote) networkstatus_vote_free(vote); if (!*msg_out) @@ -1020,3 +1020,4 @@ dirvote_compute_consensus(void) smartlist_free(votes); return -1; } + |