diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-02-01 22:23:24 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-02-01 22:23:24 -0500 |
commit | 077549e0d468ff47fdf3e00bb3cfdb929ac8324f (patch) | |
tree | 665026b329447d28a41f740ac1778a3fb0b87468 | |
parent | d5142642b8e6c45449158efdb8f8e87af4dafde8 (diff) | |
download | musl-077549e0d468ff47fdf3e00bb3cfdb929ac8324f.tar.gz musl-077549e0d468ff47fdf3e00bb3cfdb929ac8324f.tar.bz2 musl-077549e0d468ff47fdf3e00bb3cfdb929ac8324f.tar.xz musl-077549e0d468ff47fdf3e00bb3cfdb929ac8324f.zip |
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.
-rw-r--r-- | src/thread/pthread_create.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 4c1decaa..1e55a6f9 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -188,7 +188,7 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attrp if (ret < 0) { a_dec(&libc.threads_minus_1); - munmap(map, size); + if (map) munmap(map, size); return EAGAIN; } |