From: Ulrich Drepper Date: Sat, 10 Jul 1999 09:57:24 +0000 (+0000) Subject: (pthread_handle_create): Free mmap region after stack if clone failed. X-Git-Tag: cvs/glibc_2-1-2~283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=667217ce8e6ee57d06b4ee7e04242f59d8a8a5ea;p=thirdparty%2Fglibc.git (pthread_handle_create): Free mmap region after stack if clone failed. --- diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index f390aa13e86..f783bb1a138 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -379,10 +379,10 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr, /* Free the stack if we allocated it */ if (attr == NULL || !attr->__stackaddr_set) { - munmap((caddr_t)((char *)(new_thread+1) - INITIAL_STACK_SIZE), - INITIAL_STACK_SIZE); if (new_thread->p_guardsize != 0) munmap(new_thread->p_guardaddr, new_thread->p_guardsize); + munmap((caddr_t)((char *)(new_thread+1) - INITIAL_STACK_SIZE), + INITIAL_STACK_SIZE); } __pthread_handles[sseg].h_descr = NULL; __pthread_handles[sseg].h_bottom = NULL;