提交 6f02bdfc 编写于 作者: D Denis Efremov 提交者: 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: NDenis Efremov <efremov@linux.com>
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册