From: Hans Kristian Rosbach Date: Sat, 10 Jan 2026 20:31:06 +0000 (+0100) Subject: deflateinit was still checking for failed secondary allocations, this is X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29977851bfc9e6eee5c7a43acc355d615726029b;p=thirdparty%2Fzlib-ng.git deflateinit was still checking for failed secondary allocations, this is no longer necessary as we only allocate a single buffer and has already been checked for failure before this. --- diff --git a/deflate.c b/deflate.c index dcd2e62a4..aa534fb29 100644 --- a/deflate.c +++ b/deflate.c @@ -349,13 +349,6 @@ int32_t ZNG_CONDEXPORT PREFIX(deflateInit2)(PREFIX3(stream) *strm, int32_t level s->pending_buf_size = s->lit_bufsize * 4; - if (s->window == NULL || s->prev == NULL || s->head == NULL || s->pending_buf == NULL) { - s->status = FINISH_STATE; - strm->msg = ERR_MSG(Z_MEM_ERROR); - PREFIX(deflateEnd)(strm); - return Z_MEM_ERROR; - } - #ifdef LIT_MEM s->d_buf = (uint16_t *)(s->pending_buf + (s->lit_bufsize << 1)); s->l_buf = s->pending_buf + (s->lit_bufsize << 2);