aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-09-19 15:58:44 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-09-24 12:03:18 -0300
commit70d9304475730a63dd8da884abc7c76ee4772cd2 (patch)
tree8b9bbada6f72cbf601f060c50145d4b38a42358d
parentf8c49d2645e5028e48ba15ec72728be121eddf95 (diff)
downloadlinux-linaro-stable-70d9304475730a63dd8da884abc7c76ee4772cd2.tar.gz
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@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1348037924-17568-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/lib/traceevent/event-parse.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index a776ed5cd2b4..acf40381b48b 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;