[PATCH 03/11] dbghelp: Fix a leak of the Mach-O module structure by adding a module_remove callback.
Ken Thomases
ken at codeweavers.com
Wed Jun 24 17:13:55 CDT 2015
---
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 31beafa..73beb57 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -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
*
* 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,
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;
--
1.9.5 (Apple Git-50.3)
More information about the wine-patches
mailing list