perf tracepoint: Fix memory leak in is_valid_tracepoint()
authorYang Jihong <yangjihong1@huawei.com>
Fri, 21 Apr 2023 02:59:53 +0000 (02:59 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 2 May 2023 11:36:14 +0000 (08:36 -0300)
commit9b86c49710eec7b4fbb78a0232b2dd0972a2b576
tree68352a94ea39157dd7648f90732e2556a044daef
parent6bf86cada3eb8ec3eb80cdce5280e7a22dac8b01
perf tracepoint: Fix memory leak in is_valid_tracepoint()

When is_valid_tracepoint() returns 1, need to call put_events_file() to
free `dir_path`.

Fixes: 25a7d914274de386 ("perf parse-events: Use get/put_events_file()")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230421025953.173826-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/tracepoint.c