/* keep the extra fields at the beginning. the last static_tab field
contains the ending NULL-fields. */
- tab = ret_tab = t_malloc_no0((*count + auth_count) * sizeof(*tab));
- memset(tab, 0, *count * sizeof(*tab));
+ tab = ret_tab = t_new(struct var_expand_table, *count + auth_count);
tab += *count;
*count += auth_count;
/* create new iovec */
prefix = t_strdup_printf("%llx\r\n", (unsigned long long)tcstream->chunk_size);
iov_count = iov_count_new + 2;
- iov_new = t_malloc_no0(sizeof(struct const_iovec) * iov_count);
+ iov_new = t_new(struct const_iovec, iov_count);
iov_new[0].iov_base = prefix;
iov_new[0].iov_len = strlen(prefix);
memcpy(&iov_new[1], iov, sizeof(struct const_iovec) * iov_count_new);
count++;
*ips_count = count;
- *ips = t_malloc_no0(sizeof(struct ip_addr) * count);
+ *ips = t_new(struct ip_addr, count);
count = 0;
for (ai = origai; ai != NULL; ai = ai->ai_next, count++) {