[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-70d9304475730a63dd8da884abc7c76ee4772cd2@git.kernel.org>
Date: Wed, 26 Sep 2012 22:39:17 -0700
From: tip-bot for Namhyung Kim <namhyung.kim@....com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
mingo@...nel.org, a.p.zijlstra@...llo.nl, namhyung.kim@....com,
namhyung@...nel.org, fweisbec@...il.com, rostedt@...dmis.org,
tglx@...utronix.de
Subject: [tip:perf/core] tools lib traceevent:
Free field if an error occurs on process_flags/symbols
Commit-ID: 70d9304475730a63dd8da884abc7c76ee4772cd2
Gitweb: http://git.kernel.org/tip/70d9304475730a63dd8da884abc7c76ee4772cd2
Author: Namhyung Kim <namhyung.kim@....com>
AuthorDate: Wed, 19 Sep 2012 15:58:44 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 24 Sep 2012 12:03:18 -0300
tools lib traceevent: Free field if an error occurs on process_flags/symbols
The field should be freed on error paths.
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Steven Rostedt <rostedt@...dmis.org>
Link: http://lkml.kernel.org/r/1348037924-17568-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/lib/traceevent/event-parse.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index a776ed5..acf4038 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2247,7 +2247,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
type = process_op(event, field, &token);
if (test_type_token(type, token, EVENT_DELIM, ","))
- goto out_free;
+ goto out_free_field;
free_token(token);
arg->flags.field = field;
@@ -2269,7 +2269,9 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
type = read_token_item(tok);
return type;
- out_free:
+out_free_field:
+ free_arg(field);
+out_free:
free_token(token);
*tok = NULL;
return EVENT_ERROR;
@@ -2289,7 +2291,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
type = process_arg(event, field, &token);
if (test_type_token(type, token, EVENT_DELIM, ","))
- goto out_free;
+ goto out_free_field;
arg->symbol.field = field;
@@ -2301,7 +2303,9 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
type = read_token_item(tok);
return type;
- out_free:
+out_free_field:
+ free_arg(field);
+out_free:
free_token(token);
*tok = NULL;
return EVENT_ERROR;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists