[tor-commits] [tor/master] Allocate vote_microdesc_hash_t using tor_malloc_zero().

nickm at torproject.org nickm at torproject.org
Tue Sep 4 22:24:07 UTC 2012


commit d34c690e54568a1b7813202509491b75f206e8b9
Author: Linus Nordberg <linus at torproject.org>
Date:   Tue Sep 4 19:44:13 2012 +0200

    Allocate vote_microdesc_hash_t using tor_malloc_zero().
    
    In case the struct grows in the future. Shouldn't be too expensive.
---
 src/or/dirserv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 09430fe..f229e59 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2798,7 +2798,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
           vote_microdesc_hash_t *h;
           dirvote_format_microdesc_vote_line(buf, sizeof(buf), md,
                                              cmr->low, cmr->high);
-          h = tor_malloc(sizeof(vote_microdesc_hash_t));
+          h = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
           h->microdesc_hash_line = tor_strdup(buf);
           h->next = vrs->microdesc;
           vrs->microdesc = h;





More information about the tor-commits mailing list