Fixed use after free.
This commit is contained in:
parent
77a3c0ca4a
commit
51cb07b0f4
@ -426,6 +426,7 @@ HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttribu
|
||||
|
||||
VOID ExitThread(DWORD dwExitCode)
|
||||
{
|
||||
DWORD rc;
|
||||
pthread_t tid = pthread_self();
|
||||
|
||||
if (!thread_list)
|
||||
@ -460,10 +461,11 @@ VOID ExitThread(DWORD dwExitCode)
|
||||
ListDictionary_Unlock(thread_list);
|
||||
set_event(thread);
|
||||
|
||||
rc = thread->dwExitCode;
|
||||
if (thread->detached || !thread->started)
|
||||
cleanup_handle(thread);
|
||||
|
||||
pthread_exit((void*) (size_t) thread->dwExitCode);
|
||||
pthread_exit((void*) (size_t) rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user