mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
fs/squashfs: sqfs_concat_tokens: check if malloc succeeds
memory allocation should always be checked Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
This commit is contained in:
parent
4c83d27557
commit
dc3312c43c
1 changed files with 3 additions and 0 deletions
|
@ -242,6 +242,9 @@ static char *sqfs_concat_tokens(char **token_list, int token_count)
|
|||
length = sqfs_get_tokens_length(token_list, token_count);
|
||||
|
||||
result = malloc(length + 1);
|
||||
if (!result)
|
||||
return NULL;
|
||||
|
||||
result[length] = '\0';
|
||||
|
||||
for (i = 0; i < token_count; i++) {
|
||||
|
|
Loading…
Reference in a new issue