ctx->sort_strings = i_new(const char *, ctx->last_seq + 1);
ctx->sort_string_pool = pool =
pool_alloconly_create("sort strings", 1024*64);
- str = t_str_new(512);
+ str = str_new(default_pool, 512);
nodes = array_get_modifiable(&ctx->zero_nodes, &count);
for (i = 0; i < count; i++) {
i_assert(nodes[i].seq <= ctx->last_seq);
- index_sort_header_get(mail, nodes[i].seq, sort_type, str);
- ctx->sort_strings[nodes[i].seq] = str_len(str) == 0 ? "" :
- p_strdup(pool, str_c(str));
+ T_BEGIN {
+ index_sort_header_get(mail, nodes[i].seq,
+ sort_type, str);
+ ctx->sort_strings[nodes[i].seq] =
+ str_len(str) == 0 ? "" :
+ p_strdup(pool, str_c(str));
+ } T_END;
}
+ str_free(&str);
/* we have all strings, sort nodes based on them */
static_zero_cmp_context = ctx;