Commit 8236296 for zlib
commit 8236296e42776f1a2317eb596a6b9753bbe76159
Author: xjdeng <micro6947@gmail.com>
Date: Wed Oct 22 15:13:55 2025 +0800
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?)
diff --git a/test/minigzip.c b/test/minigzip.c
index 541f371..1855575 100644
--- a/test/minigzip.c
+++ b/test/minigzip.c
@@ -438,6 +438,7 @@ static void file_compress(char *file, char *mode) {
}
out = gzopen(outfile, mode);
if (out == NULL) {
+ fclose(in);
fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
exit(1);
}
@@ -480,6 +481,7 @@ static void file_uncompress(char *file) {
}
out = fopen(outfile, "wb");
if (out == NULL) {
+ gzclose(in);
perror(file);
exit(1);
}