From: Nathan Moinvaziri Date: Mon, 9 Nov 2020 02:26:06 +0000 (-0800) Subject: Fixed coverity dereference after null check in gz_compress CID 303796. X-Git-Tag: v2.0.0-RC1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9933875a35ba09d1ba3c9faed16bd43a63e95d4;p=thirdparty%2Fzlib-ng.git Fixed coverity dereference after null check in gz_compress CID 303796. --- diff --git a/test/minigzip.c b/test/minigzip.c index 21cf8a36..2e4ef8e2 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -101,7 +101,10 @@ void gz_compress(FILE *in, gzFile out) { if (gz_compress_mmap(in, out) == Z_OK) return; #endif buf = (char *)calloc(BUFLEN, 1); - if (buf == NULL) perror("out of memory"); + if (buf == NULL) { + perror("out of memory"); + exit(1); + } for (;;) { len = (int)fread(buf, 1, BUFLEN, in);