提交 077549e0 编写于 作者: R Rich Felker

if pthread_create fails, it must not attempt mmap if there is no mapping

this bug was introduced when support for application-provided stacks
was originally added.
上级 d5142642
...@@ -188,7 +188,7 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attrp ...@@ -188,7 +188,7 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attrp
if (ret < 0) { if (ret < 0) {
a_dec(&libc.threads_minus_1); a_dec(&libc.threads_minus_1);
munmap(map, size); if (map) munmap(map, size);
return EAGAIN; return EAGAIN;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册