Module: wine Branch: master Commit: 364099f528f83f0056f00178d9be6fe332692dc7 URL: https://source.winehq.org/git/wine.git/?a=commit;h=364099f528f83f0056f00178d...
Author: Alexandre Julliard julliard@winehq.org Date: Sun Jun 27 19:32:48 2021 +0200
ntdll: Avoid crash on shutting down partially initialized thread.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 54806b0ab22..14cc105b64d 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -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] );