ntdll: Avoid crash on shutting down partially initialized thread.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-06-27 19:32:48 +02:00
parent ee65ea88ee
commit 364099f528
1 changed files with 1 additions and 1 deletions

View File

@ -3411,7 +3411,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] );