[PATCH 35/91] perf parse-events: Fix another memory leaks found on parse_events()
From: Arnaldo Carvalho de Melo
Date: Wed May 06 2020 - 11:24:59 EST
From: Ian Rogers <irogers@xxxxxxxxxx>
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 6ece67ed244a..c4ca932d092d 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
--
2.21.1