diff options
author | Roger Dingledine <arma@torproject.org> | 2003-11-18 08:20:19 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-11-18 08:20:19 +0000 |
commit | ac56486bf64df4eb3264e87538ac415ce42eefd9 (patch) | |
tree | ddb0e7d6532602d991fcb6ac1d5919279063d30d /src/or/onion.c | |
parent | ec02f83f9411f5737f1e77443d282c7e3feda0e4 (diff) | |
download | tor-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.c | 6 |
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) { |