From: Ulrich Drepper Date: Sat, 8 Mar 2003 09:41:16 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2_3_3~1332 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d130a3415649b36ac672ab49068aec7c02a8135c;p=thirdparty%2Fglibc.git Update. 2003-03-08 Ulrich Drepper * allocatestack.c (allocate_stack): If mprotect() fails free the TLS memory. --- diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 562e38bffd3..4f5dc87d060 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2003-03-08 Ulrich Drepper + + * allocatestack.c (allocate_stack): If mprotect() fails free the + TLS memory. + 2003-03-07 Ulrich Drepper * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions. diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 4aec8755480..31cff2a1c2b 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);