From: Ian Rogers <irog...@google.com>

Fix another memory leak found by applying LLVM's libfuzzer on parse_events().

Signed-off-by: Ian Rogers <irog...@google.com>
Acked-by: Jiri Olsa <jo...@redhat.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: Leo Yan <leo....@linaro.org>
Cc: Mark Rutland <mark.rutl...@arm.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Stephane Eranian <eran...@google.com>
Cc: clang-built-li...@googlegroups.com
Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irog...@google.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 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

Reply via email to