Re: [PATCH 3/3] perf, stat: Fix free memory access / memory leaks in metrics

From: Jiri Olsa
Date: Tue Sep 24 2019 - 10:44:22 EST


On Tue, Sep 24, 2019 at 07:08:56AM -0700, Andi Kleen wrote:
> > > expr__ctx_init(&pctx);
> > > + /* Must be first id entry */
> > > + expr__add_id(&pctx, name, avg);
> >
> > hum, shouldn't u instead use strdup(name) instead of name?
>
> The cleanup loop later skips freeing the first entry.

aaah, nice ;-)

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

thanks,
jirka