Skip to content

Commit

Permalink
lib-index: mail_cache_lookup_headers() - Allow using datastack pool
Browse files Browse the repository at this point in the history
This fixes assert caused by 53712af:
Panic: pool_data_stack_realloc(): stack frame changed
  • Loading branch information
sirainen committed Aug 30, 2018
1 parent 6df4f44 commit 41ecdb6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib-index/mail-cache-lookup.c
Expand Up @@ -599,16 +599,19 @@ int mail_cache_lookup_headers(struct mail_cache_view *view, string_t *dest,
uint32_t seq, unsigned int field_idxs[],
unsigned int fields_count)
{
pool_t pool;
pool_t pool = NULL;
int ret;

T_BEGIN {
if (buffer_get_pool(dest)->datastack_pool)
ret = mail_cache_lookup_headers_real(view, dest, seq,
field_idxs, fields_count,
&pool);
else T_BEGIN {
ret = mail_cache_lookup_headers_real(view, dest, seq,
field_idxs, fields_count,
&pool);
if (pool != NULL)
pool_unref(&pool);
} T_END;
pool_unref(&pool);
return ret;
}

Expand Down

0 comments on commit 41ecdb6

Please sign in to comment.