From: Maks Mishin Date: Wed, 18 Sep 2024 08:58:07 +0000 (+0300) Subject: elflint: Fix memory leak in check_gnu_hash function X-Git-Tag: elfutils-0.192~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b47bdee08a16078c8a4d81b440f99f630e3e5631;p=thirdparty%2Felfutils.git elflint: Fix memory leak in check_gnu_hash function Dynamic memory, referenced by 'collected', is allocated at elflint.c:2235 and lost at elflint.c:2296. Found by RASU JSC with SVACE. Signed-off-by: Maks Mishin --- diff --git a/src/elflint.c b/src/elflint.c index e56e1465..cdc6108d 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -2293,6 +2293,7 @@ section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"), section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"), idx, section_name (ebl, idx), symidx, cnt - (4 + bitmask_words)); + free (collected.p32); return; } if (classbits == 32)