diff --git a/src/or/buffers.c b/src/or/buffers.c index 5960eff2f7..fb0e2f1064 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -119,9 +119,9 @@ int find_on_inbuf(char *string, int string_len, buf_t *buf) { */ buf_t *buf_new_with_capacity(size_t size) { buf_t *buf; - buf = (buf_t*)tor_malloc(sizeof(buf_t)); + buf = tor_malloc(sizeof(buf_t)); buf->magic = BUFFER_MAGIC; - buf->mem = (char *)tor_malloc(size); + buf->mem = tor_malloc(size); buf->len = size; buf->datalen = 0; // memset(buf->mem,0,size); diff --git a/src/or/onion.c b/src/or/onion.c index 7d979d503e..295dc4fec2 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -513,7 +513,7 @@ int onion_extend_cpath(crypt_path_t **head_ptr, cpath_build_state_t *state, rout log_fn(LOG_DEBUG,"Chose router %s for hop %d (exit is %s)", choice->nickname, cur_len, state->chosen_exit); - hop = (crypt_path_t *)tor_malloc_zero(sizeof(crypt_path_t)); + hop = tor_malloc_zero(sizeof(crypt_path_t)); /* link hop into the cpath, at the end. */ onion_append_to_cpath(head_ptr, hop); @@ -568,7 +568,7 @@ onion_skin_create(crypto_pk_env_t *dest_router_key, pkbytes = crypto_pk_keysize(dest_router_key); assert(dhbytes == 128); assert(pkbytes == 128); - challenge = (char *)tor_malloc_zero(ONIONSKIN_CHALLENGE_LEN-CIPHER_KEY_LEN); + challenge = tor_malloc_zero(ONIONSKIN_CHALLENGE_LEN-CIPHER_KEY_LEN); if (crypto_dh_get_public(dh, challenge, dhbytes)) goto err;