mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
lib/inflate: fix memory leak in inflate_fixed() on inflate_codes() failure
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. Link: https://lkml.kernel.org/r/20260306161612.2811703-1-objecting@objecting.org Signed-off-by: Josh Law <objecting@objecting.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e54f7f67e9
commit
bc6cc36855
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user