Re: [PATCH v2 26/26] perf hist: Fix srcline memory leak

From: Arnaldo Carvalho de Melo
Date: Mon Jun 12 2023 - 10:15:44 EST


Em Thu, Jun 08, 2023 at 04:28:23PM -0700, Ian Rogers escreveu:
> srcline isn't freed if it is SRCLINE_UNKNOWN. Avoid strduping in this
> case as such strdups are redundant and leak memory.

The patch is ok as its what the rest of the code is doing, i.e. strcmp()
to check if a srcline is the unknown one, but how about the following
patch on top of yours?