mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
This commit is contained in:
parent
16e6b8fdfd
commit
e54b34aed1
1 changed files with 1 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ static enum event_type read_token(char **tok)
|
|||
(strcmp(token, "=") == 0 || strcmp(token, "!") == 0) &&
|
||||
pevent_peek_char() == '~') {
|
||||
/* append it */
|
||||
*tok = malloc(3);
|
||||
*tok = malloc_or_die(3);
|
||||
sprintf(*tok, "%c%c", *token, '~');
|
||||
free_token(token);
|
||||
/* Now remove the '~' from the buffer */
|
||||
|
|
|
|||
Loading…
Reference in a new issue