aboutsummaryrefslogtreecommitdiff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-08 09:41:16 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-08 09:41:16 +0000
commitd130a3415649b36ac672ab49068aec7c02a8135c (patch)
tree76a09371a8ccb63a5e6bffdce348504aeadcb4a5 /nptl/allocatestack.c
parent35457070d26e3ac6f0132e993bfea1bff3fef977 (diff)
downloadglibc-d130a3415649b36ac672ab49068aec7c02a8135c.zip
glibc-d130a3415649b36ac672ab49068aec7c02a8135c.tar.gz
glibc-d130a3415649b36ac672ab49068aec7c02a8135c.tar.bz2
Update.
2003-03-08 Ulrich Drepper <drepper@redhat.com> * allocatestack.c (allocate_stack): If mprotect() fails free the TLS memory.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 4aec875..31cff2a 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -439,9 +439,12 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
lll_unlock (stack_cache_lock);
- /* Free the memory regardless of whether the size of the
- cache is over the limit or not. If this piece of
- memory caused problems we better do not use it
+ /* Get rid of the TLS block we allocated. */
+ _dl_deallocate_tls (pd, false);
+
+ /* Free the stack memory regardless of whether the size
+ of the cache is over the limit or not. If this piece
+ of memory caused problems we better do not use it
anymore. Uh, and we ignore possible errors. There
is nothing we could do. */
(void) munmap (mem, size);