aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxjdeng <micro6947@gmail.com>2025-10-22 15:13:55 +0800
committerMark Adler <git@madler.net>2026-01-28 11:58:25 -0800
commit8236296e42776f1a2317eb596a6b9753bbe76159 (patch)
tree6bd22afb145f83814c5b35387fc41110aceb9520
parent202ea98552ad36908c12109e728a7d0d7c603535 (diff)
downloadzlib-8236296e42776f1a2317eb596a6b9753bbe76159.tar.gz
zlib-8236296e42776f1a2317eb596a6b9753bbe76159.tar.bz2
zlib-8236296e42776f1a2317eb596a6b9753bbe76159.zip
Fix resource closures in test/minigzip.c.
Not really needed, since exit() is called. But just in case the code is somehow later reused without the exit()'s. (By AI?)
-rw-r--r--test/minigzip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/minigzip.c b/test/minigzip.c
index 541f3716..1855575a 100644
--- a/test/minigzip.c
+++ b/test/minigzip.c
@@ -438,6 +438,7 @@ static void file_compress(char *file, char *mode) {
438 } 438 }
439 out = gzopen(outfile, mode); 439 out = gzopen(outfile, mode);
440 if (out == NULL) { 440 if (out == NULL) {
441 fclose(in);
441 fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); 442 fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
442 exit(1); 443 exit(1);
443 } 444 }
@@ -480,6 +481,7 @@ static void file_uncompress(char *file) {
480 } 481 }
481 out = fopen(outfile, "wb"); 482 out = fopen(outfile, "wb");
482 if (out == NULL) { 483 if (out == NULL) {
484 gzclose(in);
483 perror(file); 485 perror(file);
484 exit(1); 486 exit(1);
485 } 487 }