public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Free memory allocated in parse_events_fixup
@ 2013-07-07 20:43 David Ahern
  0 siblings, 0 replies; only message in thread
From: David Ahern @ 2013-07-07 20:43 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Andi Kleen

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-07 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-07 20:43 [PATCH] perf: Free memory allocated in parse_events_fixup David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox