Commit 378d557d authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

dbghelp: Fix a leak of the Mach-O module structure by adding a module_remove callback.

parent 8430ebc6
...@@ -943,6 +943,14 @@ BOOL macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base, ...@@ -943,6 +943,14 @@ BOOL macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base,
} }
/****************************************************************** /******************************************************************
* macho_module_remove
*/
static void macho_module_remove(struct process* pcs, struct module_format* modfmt)
{
HeapFree(GetProcessHeap(), 0, modfmt);
}
/******************************************************************
* macho_load_file * macho_load_file
* *
* Loads the information for Mach-O module stored in 'filename'. * Loads the information for Mach-O module stored in 'filename'.
...@@ -1036,7 +1044,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename, ...@@ -1036,7 +1044,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
macho_info->module->format_info[DFI_MACHO] = modfmt; macho_info->module->format_info[DFI_MACHO] = modfmt;
modfmt->module = macho_info->module; modfmt->module = macho_info->module;
modfmt->remove = NULL; modfmt->remove = macho_module_remove;
modfmt->loc_compute = NULL; modfmt->loc_compute = NULL;
modfmt->u.macho_info = macho_module_info; modfmt->u.macho_info = macho_module_info;
......
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