Although there is now code in p_realloc() that it should be just as
efficient, this makes profiling somewhat nicer since it can better
distinguish between actual reallocs and initial allocs.
i_assert(size > buf->alloc);
- buf->w_buffer = p_realloc(buf->pool, buf->w_buffer, buf->alloc, size);
+ if (buf->w_buffer == NULL)
+ buf->w_buffer = p_malloc(buf->pool, size);
+ else
+ buf->w_buffer = p_realloc(buf->pool, buf->w_buffer, buf->alloc, size);
buf->alloc = size;
buf->r_buffer = buf->w_buffer;