]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Allocate vote_microdesc_hash_t using tor_malloc_zero().
authorLinus Nordberg <linus@torproject.org>
Tue, 4 Sep 2012 17:44:13 +0000 (19:44 +0200)
committerLinus Nordberg <linus@torproject.org>
Tue, 4 Sep 2012 18:19:41 +0000 (20:19 +0200)
In case the struct grows in the future. Shouldn't be too expensive.

src/or/dirserv.c

index 09430feb2a0497577cd2dfe53a5d88519d3c1b7f..f229e5995f81c226a0129719a1002ff18c77062d 100644 (file)
@@ -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;