summaryrefslogtreecommitdiff
path: root/test/minigzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/minigzip.c')
-rw-r--r--test/minigzip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/minigzip.c b/test/minigzip.c
index 21cf8a3..2e4ef8e 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);