diff options
| author | jakob <jakob@memeware.net> | 2017-05-19 20:15:52 -0400 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-05-19 20:15:52 -0400 |
| commit | d30014068a5468463d4a81692993a2fedd799a71 (patch) | |
| tree | 2f0c663b4cec32f93de8e60d65ccb48390cce426 /src/compress.c | |
| parent | 1a386655395a4259a48108ed78c1f61d9b8ecbb4 (diff) | |
Rewrote significant parts of the repacker
Diffstat (limited to 'src/compress.c')
| -rw-r--r-- | src/compress.c | 11 |
1 files changed, 7 insertions, 4 deletions
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; |