From d30014068a5468463d4a81692993a2fedd799a71 Mon Sep 17 00:00:00 2001 From: jakob Date: Fri, 19 May 2017 20:15:52 -0400 Subject: Rewrote significant parts of the repacker --- src/compress.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/compress.c') diff --git a/src/compress.c b/src/compress.c index 3137145..71e0ae3 100644 --- a/src/compress.c +++ b/src/compress.c @@ -65,10 +65,13 @@ struct stream *stream_inflate(struct stream *s, size_t len, /* Deflates `s` into a newly allocated stream structure. */ struct stream *stream_deflate(struct stream *s, size_t len) { struct stream *new = stream_new(len); - z_stream strm; - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; + if (new == NULL) + return NULL; + + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; if (deflateInit(&strm, LEVEL) != Z_OK) return NULL; -- cgit v1.3