[PATCH] lib/inflate: fix memory leak in inflate_fixed() on inflate_codes() failure
From: Josh Law
Date: Fri Mar 06 2026 - 11:22:04 EST
When inflate_codes() fails in inflate_fixed(), only the length list 'l'
is freed, but the Huffman tables 'tl' and 'td' are leaked. Add the
missing huft_free() calls on the error path.
Signed-off-by: Josh Law <objecting@xxxxxxxxxxxxx>
---
lib/inflate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/inflate.c b/lib/inflate.c
index eab886baa1b4..5b1e70d0ce8c 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -811,6 +811,8 @@ DEBG("<fix");
/* decompress until an end-of-block code */
if (inflate_codes(tl, td, bl, bd)) {
+ huft_free(tl);
+ huft_free(td);
free(l);
return 1;
}
--
2.43.0