aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-11-18 08:20:19 +0000
committerRoger Dingledine <arma@torproject.org>2003-11-18 08:20:19 +0000
commitac56486bf64df4eb3264e87538ac415ce42eefd9 (patch)
treeddb0e7d6532602d991fcb6ac1d5919279063d30d /src/or/onion.c
parentec02f83f9411f5737f1e77443d282c7e3feda0e4 (diff)
downloadtor-ac56486bf64df4eb3264e87538ac415ce42eefd9.tar
tor-ac56486bf64df4eb3264e87538ac415ce42eefd9.tar.gz
use the tor_malloc_zero wrapper
svn:r837
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 8cb2cddbe..b50dd2bdc 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -34,8 +34,7 @@ static int ol_length=0;
int onion_pending_add(circuit_t *circ) {
struct onion_queue_t *tmp;
- tmp = tor_malloc(sizeof(struct onion_queue_t));
- memset(tmp, 0, sizeof(struct onion_queue_t));
+ tmp = tor_malloc_zero(sizeof(struct onion_queue_t));
tmp->circ = circ;
if(!ol_tail) {
@@ -460,8 +459,7 @@ int onion_extend_cpath(crypt_path_t **head_ptr, cpath_build_state_t *state, rout
}
/* Okay, so we haven't used 'choice' before. */
- hop = (crypt_path_t *)tor_malloc(sizeof(crypt_path_t));
- memset(hop, 0, sizeof(crypt_path_t));
+ hop = (crypt_path_t *)tor_malloc_zero(sizeof(crypt_path_t));
/* link hop into the cpath, at the end. */
if (*head_ptr) {