From fd0391c3d7796bf37856c2a988e0b5478f85f250 Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:53:32 +0200 Subject: [PATCH] fix leak in compress.mod --- src/mod/compress.mod/compress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/compress.mod/compress.c b/src/mod/compress.mod/compress.c index c4a86fb76..f41617c62 100644 --- a/src/mod/compress.mod/compress.c +++ b/src/mod/compress.mod/compress.c @@ -88,8 +88,10 @@ static int is_compressedfile(char *filename) if (!zin) return COMPF_FAILED; len1 = gzread(zin, buf1, sizeof(buf1)); - if (len1 < 0) + if (len1 < 0) { + gzclose(zin); return COMPF_FAILED; + } if (gzclose(zin) != Z_OK) return COMPF_FAILED;