lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 34/91] perf parse-events: Fix memory leaks found on parse_events
    Date
    From: Ian Rogers <irogers@google.com>

    free_list_evsel() deals with tools/perf/ evsels, not with libperf
    perf_evsels, use the right destructor and avoid a leak, as
    evsel__delete() will delete something perf_evsel__delete() doesn't.

    Signed-off-by: Ian Rogers <irogers@google.com>

    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Acked-by: Jiri Olsa <jolsa@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: clang-built-linux@googlegroups.com
    Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com
    [ split from a larger patch ]
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    ---
    tools/perf/util/parse-events.y | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
    index e879eb257874..6ece67ed244a 100644
    --- a/tools/perf/util/parse-events.y
    +++ b/tools/perf/util/parse-events.y
    @@ -44,7 +44,7 @@ static void free_list_evsel(struct list_head* list_evsel)

    list_for_each_entry_safe(evsel, tmp, list_evsel, core.node) {
    list_del_init(&evsel->core.node);
    - perf_evsel__delete(evsel);
    + evsel__delete(evsel);
    }
    free(list_evsel);
    }
    --
    2.21.1
    \
     
     \ /
      Last update: 2020-05-06 17:25    [W:4.063 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site