]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(pthread_handle_create): Free mmap region after stack if clone failed.
authorUlrich Drepper <drepper@redhat.com>
Sat, 10 Jul 1999 09:57:24 +0000 (09:57 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 10 Jul 1999 09:57:24 +0000 (09:57 +0000)
linuxthreads/manager.c

index f390aa13e868cdc26931139795471a3229da1205..f783bb1a138f233bfeee59b09b2af15f607315e2 100644 (file)
@@ -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;