[PATCH] readelf: Fix memory leak in print_hash_info()
Mark Wielaard
mark@klomp.org
Tue Jul 2 11:33:10 GMT 2024
Hi Maks,
On Tue, Jul 02, 2024 at 12:05:34AM +0300, Maks Mishin wrote:
> Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
> ---
> src/readelf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/readelf.c b/src/readelf.c
> index c945b371..48035264 100644
> --- a/src/readelf.c
> +++ b/src/readelf.c
> @@ -3597,6 +3597,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx,
> {
> error (0, 0, _("invalid sh_link value in section %zu"),
> elf_ndxscn (scn));
> + free (counts);
> return;
> }
That looks correct. Pushed.
Thanks,
Mark
More information about the Elfutils-devel
mailing list