Re: [PATCH] elflint: Fix memory leak in check_gnu_hash function

2024-09-20 Thread Aaron Merey
Hi Maks,

On Wed, Sep 18, 2024 at 4:58 AM Maks Mishin  wrote:
>
> 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 
> ---
>  src/elflint.c | 1 +
>  1 file changed, 1 insertion(+)
>
> 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)
> --
> 2.34.1
>

Thanks, merged as commit b47bdee08a1607

Aaron



Re: [PATCH] elflint: Fix memory leak in check_gnu_hash function

2024-09-20 Thread Maks Mishin
Thanks for the feedback!

пт, 20 сент. 2024 г. в 19:07, Aaron Merey :

> Hi Maks,
>
> On Wed, Sep 18, 2024 at 4:58 AM Maks Mishin 
> wrote:
> >
> > 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 
> > ---
> >  src/elflint.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > 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)
> > --
> > 2.34.1
> >
>
> Thanks, merged as commit b47bdee08a1607
>
> Aaron
>
> --
С уважением,
Мишин Максим Александрович
+7 (915) 958-41-07
maks.mishi...@gmail.com