[PATCH] perf: Free memory allocated in parse_events_fixup

David Ahern
2013-07-07T20:43:35Z

578d9c6 added a memory allocation that is not freed. Do that when
the scanner is done.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/parse-events.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2c460ed..707368f 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -846,7 +846,9 @@ static int parse_events_fixup(int ret, const char *str, void *data,
free(o);
if (!s)
return -ENOMEM;
- return parse_events__scanner(s, data, start_token);
+ ret = parse_events__scanner(s, data, start_token);
+ free(s);
+ return ret;
}

static int parse_events__scanner(const char *str, void *data, int start_token)
--
1.7.10.1