Commit 6f02bdfc authored by Denis Efremov's avatar Denis Efremov Committed by Masahiro Yamada

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: default avatarDenis Efremov <efremov@linux.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 389c9af7
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment