Commit e19b18dd authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dbghelp: Fix use after free.

parent 2f2891e5
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment