ntdll: Make sure to not unmap anything from reserved areas
when using NtFreeVirtualMemory with the MEM_SYSTEM flag.
diff --git a/loader/pthread.c b/loader/pthread.c
index b7487a0..a976c4f 100644
--- a/loader/pthread.c
+++ b/loader/pthread.c
@@ -159,7 +159,7 @@
static void DECLSPEC_NORETURN exit_thread( struct wine_pthread_thread_info *info )
{
wine_ldt_free_fs( info->teb_sel );
- munmap( info->teb_base, info->teb_size );
+ if (info->teb_size) munmap( info->teb_base, info->teb_size );
pthread_exit( (void *)info->exit_status );
}