diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-04-23 00:58:36 -0400 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2012-07-04 00:40:31 -0400 |
commit | e54b34aed1c4082ed03f4d1f7a19276059b1e30a (patch) | |
tree | 2f6ad3e0277e0bd0864b2bda38be0c5d93175c74 /tools/lib | |
parent | 16e6b8fdfd181ac79f04ff826c42c7d8a2806a17 (diff) |
tools lib traceevent: Check result of malloc() during reading token
The malloc can fail so the return value should be checked. For now,
just use malloc_or_die().
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1335157118-14658-10-git-send-email-namhyung.kim@lge.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/traceevent/parse-filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 80d872a81f26..d54c2b4dbd9f 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
@@ -96,7 +96,7 @@ static enum event_type read_token(char **tok) | |||
96 | (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && | 96 | (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && |
97 | pevent_peek_char() == '~') { | 97 | pevent_peek_char() == '~') { |
98 | /* append it */ | 98 | /* append it */ |
99 | *tok = malloc(3); | 99 | *tok = malloc_or_die(3); |
100 | sprintf(*tok, "%c%c", *token, '~'); | 100 | sprintf(*tok, "%c%c", *token, '~'); |
101 | free_token(token); | 101 | free_token(token); |
102 | /* Now remove the '~' from the buffer */ | 102 | /* Now remove the '~' from the buffer */ |