# Re: \[PATCH\] perf symbol-elf: fix memory leak: free sdt\_note.args

- From: Arnaldo Carvalho de Melo \<acme@kernel.org\>
- Date: 2021-06-04 13:00:58 
- List: linux-perf-users
- Page: https://ratatoskr.run/linux-perf-users/2021/06/1402593
- Thread: https://ratatoskr.run/linux-perf-users/2021/06/1400514/t.md

```text
Em Thu, Jun 03, 2021 at 09:08:46PM -0700, Ian Rogers escreveu:
> On Wed, Jun 2, 2021 at 3:12 PM Riccardo Mancini [ref] wrote:
> >
> > Reported by ASan.
> 
> Did you have a reproducer for getting this to fail?
> 
> > Signed-off-by: Riccardo Mancini <redacted>
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Ian
> 
> > ---
> >  tools/perf/util/symbol-elf.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> > index 4c56aa8374344..a73345730ba90 100644
> > --- a/tools/perf/util/symbol-elf.c
> > +++ b/tools/perf/util/symbol-elf.c
> > @@ -2412,6 +2412,7 @@ int cleanup_sdt_note_list(struct list_head *sdt_notes)
> >
> >         list_for_each_entry_safe(pos, tmp, sdt_notes, note_list) {
> >                 list_del_init(&pos->note_list);
> > +               zfree(&pos->args);
> >                 zfree(&pos->name);
> >                 zfree(&pos->provider);
> >                 free(pos);
> > --
> > 2.31.1
> >

-- 

- Arnaldo
```
