*/
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);
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);
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;