From 378d557d77cb32d6855201b5fcbdf4dff460fb09 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 24 Jun 2015 17:13:55 -0500 Subject: [PATCH] dbghelp: Fix a leak of the Mach-O module structure by adding a module_remove callback. --- dlls/dbghelp/macho_module.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 31beafac3d..73beb57098 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -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;