dbghelp: Fix use after free.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2021-12-09 07:33:58 +11:00 committed by Alexandre Julliard
parent 2f2891e5d5
commit e19b18dd82
1 changed files with 1 additions and 1 deletions

View File

@ -1058,7 +1058,6 @@ BOOL WINAPI SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll)
if (!pcs) return FALSE;
module = module_find_by_addr(pcs, BaseOfDll, DMT_UNKNOWN);
if (!module) return FALSE;
if (!module_remove(pcs, module)) return FALSE;
/* remove local scope if defined inside this module */
if (pcs->localscope_pc >= module->module.BaseOfImage &&
pcs->localscope_pc < module->module.BaseOfImage + module->module.ImageSize)
@ -1066,6 +1065,7 @@ BOOL WINAPI SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll)
pcs->localscope_pc = 0;
pcs->localscope_symt = NULL;
}
module_remove(pcs, module);
return TRUE;
}