Commit 70d93044 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

tools lib traceevent: Free field if an error occurs on process_flags/symbols

The field should be freed on error paths.
Signed-off-by: default avatarNamhyung 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f8c49d26
...@@ -2247,7 +2247,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2247,7 +2247,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
type = process_op(event, field, &token); type = process_op(event, field, &token);
if (test_type_token(type, token, EVENT_DELIM, ",")) if (test_type_token(type, token, EVENT_DELIM, ","))
goto out_free; goto out_free_field;
free_token(token); free_token(token);
arg->flags.field = field; arg->flags.field = field;
...@@ -2269,7 +2269,9 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2269,7 +2269,9 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
type = read_token_item(tok); type = read_token_item(tok);
return type; return type;
out_free: out_free_field:
free_arg(field);
out_free:
free_token(token); free_token(token);
*tok = NULL; *tok = NULL;
return EVENT_ERROR; return EVENT_ERROR;
...@@ -2289,7 +2291,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2289,7 +2291,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
type = process_arg(event, field, &token); type = process_arg(event, field, &token);
if (test_type_token(type, token, EVENT_DELIM, ",")) if (test_type_token(type, token, EVENT_DELIM, ","))
goto out_free; goto out_free_field;
arg->symbol.field = field; arg->symbol.field = field;
...@@ -2301,7 +2303,9 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2301,7 +2303,9 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
type = read_token_item(tok); type = read_token_item(tok);
return type; return type;
out_free: out_free_field:
free_arg(field);
out_free:
free_token(token); free_token(token);
*tok = NULL; *tok = NULL;
return EVENT_ERROR; return EVENT_ERROR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment