modpost: add NOFAIL to strndup
Add NOFAIL check for the strndup call, because the function allocates memory and can return NULL. All calls to strdup in modpost are checked with NOFAIL. Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
389c9af7f1
commit
6f02bdfc99
|
@ -797,9 +797,9 @@ static int match(const char *sym, const char * const pat[])
|
|||
|
||||
/* "*foo*" */
|
||||
if (*p == '*' && *endp == '*') {
|
||||
char *here, *bare = strndup(p + 1, strlen(p) - 2);
|
||||
char *bare = NOFAIL(strndup(p + 1, strlen(p) - 2));
|
||||
char *here = strstr(sym, bare);
|
||||
|
||||
here = strstr(sym, bare);
|
||||
free(bare);
|
||||
if (here != NULL)
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue