Module: wine Branch: oldstable Commit: a59337fb7e0d876dc90625dcd3244c04fcb0bf32 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a59337fb7e0d876dc90625dcd...
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 (cherry picked from commit 364099f528f83f0056f00178d9be6fe332692dc7) Signed-off-by: Michael Stefaniuc mstefani@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 1f8e6c24400..35527119eae 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -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] );