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

This commit is contained in:
Ken Thomases 2015-06-24 17:13:55 -05:00 committed by Alexandre Julliard
parent 8430ebc6b5
commit 378d557d77
1 changed files with 9 additions and 1 deletions

View File

@ -942,6 +942,14 @@ BOOL macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base,
return TRUE;
}
/******************************************************************
* macho_module_remove
*/
static void macho_module_remove(struct process* pcs, struct module_format* modfmt)
{
HeapFree(GetProcessHeap(), 0, modfmt);
}
/******************************************************************
* macho_load_file
*
@ -1036,7 +1044,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
macho_info->module->format_info[DFI_MACHO] = modfmt;
modfmt->module = macho_info->module;
modfmt->remove = NULL;
modfmt->remove = macho_module_remove;
modfmt->loc_compute = NULL;
modfmt->u.macho_info = macho_module_info;