memory allocation should always be checked
Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit
dc3312c43c82ff9335b2bf4ee4f72365e824adfd]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I160a321fe56fc63476d19adbbaa62129daa03f79
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++) {