]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
deflateinit was still checking for failed secondary allocations, this is
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Sat, 10 Jan 2026 20:31:06 +0000 (21:31 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 11 Jan 2026 09:32:13 +0000 (10:32 +0100)
no longer necessary as we only allocate a single buffer and has already
been checked for failure before this.

deflate.c

index dcd2e62a4fa6dbfd140febf5ff3b67338dba1ac9..aa534fb29702cd0030f1a488a2d66f00a1a03a97 100644 (file)
--- 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);