diff options
author | Namhyung Kim <namhyung@kernel.org> | 2013-12-12 02:36:07 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-13 08:30:21 -0500 |
commit | 91dfa49bdd8ef9600d850ef68ec892eb70824e3d (patch) | |
tree | 1f329f8a801639645f2047733a3f9b663f885795 /tools/lib/traceevent | |
parent | 2e4eb10d7e59df71ab649343b3f1bff9259da15d (diff) |
tools lib traceevent: Get rid of malloc_or_die() in read_token()
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1386833777-3790-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent')
-rw-r--r-- | tools/lib/traceevent/parse-filter.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index ab9cefe320b4..246ee81e1f93 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
@@ -109,7 +109,11 @@ static enum event_type read_token(char **tok) | |||
109 | (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && | 109 | (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && |
110 | pevent_peek_char() == '~') { | 110 | pevent_peek_char() == '~') { |
111 | /* append it */ | 111 | /* append it */ |
112 | *tok = malloc_or_die(3); | 112 | *tok = malloc(3); |
113 | if (*tok == NULL) { | ||
114 | free_token(token); | ||
115 | return EVENT_ERROR; | ||
116 | } | ||
113 | sprintf(*tok, "%c%c", *token, '~'); | 117 | sprintf(*tok, "%c%c", *token, '~'); |
114 | free_token(token); | 118 | free_token(token); |
115 | /* Now remove the '~' from the buffer */ | 119 | /* Now remove the '~' from the buffer */ |
@@ -1123,6 +1127,8 @@ process_filter(struct event_format *event, struct filter_arg **parg, | |||
1123 | break; | 1127 | break; |
1124 | case EVENT_NONE: | 1128 | case EVENT_NONE: |
1125 | break; | 1129 | break; |
1130 | case EVENT_ERROR: | ||
1131 | goto fail_alloc; | ||
1126 | default: | 1132 | default: |
1127 | goto fail_print; | 1133 | goto fail_print; |
1128 | } | 1134 | } |