summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/thread/pthread_create.c2
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;
}