ntdll: Avoid crash on shutting down partially initialized thread.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 364099f528)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-06-27 19:32:48 +02:00 committed by Michael Stefaniuc
parent d1d979bf91
commit a59337fb7e
1 changed files with 1 additions and 1 deletions

View File

@ -3230,7 +3230,7 @@ void WINAPI LdrShutdownThread(void)
if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, DLL_THREAD_DETACH );
RtlAcquirePebLock();
RemoveEntryList( &NtCurrentTeb()->TlsLinks );
if (NtCurrentTeb()->TlsLinks.Flink) RemoveEntryList( &NtCurrentTeb()->TlsLinks );
if ((pointers = NtCurrentTeb()->ThreadLocalStoragePointer))
{
for (i = 0; i < tls_module_count; i++) RtlFreeHeap( GetProcessHeap(), 0, pointers[i] );