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

Signed-off-by: David Ahern <dsah...@gmail.com>
Cc: Andi Kleen <a...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to