* data and need a buffer now. We reuse the same buffer, as it's
* not used out of the scope of a series of add_data()*, end().
*/
- if (unlikely(!tmpbuf.size)) {
- /* this is the first time we need the compression buffer */
- if (b_alloc(&tmpbuf) == NULL)
- return -1; /* no memory */
- }
+ if (b_alloc(&tmpbuf) == NULL)
+ return -1; /* no memory */
b_reset(&tmpbuf);
memcpy(b_tail(&tmpbuf), comp_ctx->direct_ptr, comp_ctx->direct_len);
b_add(&tmpbuf, comp_ctx->direct_len);
static int
comp_flt_init_per_thread(struct proxy *px, struct flt_conf *fconf)
{
- if (!tmpbuf.size && b_alloc(&tmpbuf) == NULL)
+ if (b_alloc(&tmpbuf) == NULL)
return -1;
- if (!zbuf.size && b_alloc(&zbuf) == NULL)
+ if (b_alloc(&zbuf) == NULL)
return -1;
return 0;
}