[tip: perf/core] perf parse-events: Fix another memory leaks found on parse_events()
From: tip-bot2 for Ian Rogers
Date: Fri May 08 2020 - 09:06:05 EST
The following commit has been merged into the perf/core branch of tip:
Commit-ID: ba08829aace99b23da31b9b71d8ed5d40a44ed49
Gitweb: https://git.kernel.org/tip/ba08829aace99b23da31b9b71d8ed5d40a44ed49
Author: Ian Rogers <irogers@xxxxxxxxxx>
AuthorDate: Wed, 18 Mar 2020 19:31:00 -07:00
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitterDate: Tue, 05 May 2020 16:35:29 -03:00
perf parse-events: Fix another memory leaks found on parse_events()
Fix another memory leak found by applying LLVM's libfuzzer on parse_events().
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Leo Yan <leo.yan@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: clang-built-linux@xxxxxxxxxxxxxxxx
Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@xxxxxxxxxx
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/parse-events.y | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 6ece67e..c4ca932 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -326,6 +326,7 @@ PE_NAME opt_pmu_config
}
parse_events_terms__delete($2);
parse_events_terms__delete(orig_terms);
+ free(pattern);
free($1);
$$ = list;
#undef CLEANUP_YYABORT