From 41a04cc0de0349323639a0f6e295ef96a70d65a4 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 8 Sep 2005 11:03:45 +0000 Subject: [PATCH] Fix memory leaks. --- dlls/msi/events.c | 5 ++++- dlls/msi/helpers.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msi/events.c b/dlls/msi/events.c index 559f857a72c..533b343323c 100644 --- a/dlls/msi/events.c +++ b/dlls/msi/events.c @@ -236,8 +236,11 @@ static UINT ControlEvent_SetTargetPath(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { LPWSTR path = load_dynamic_property(package,argument, NULL); + UINT r; /* failure to set the path halts the executing of control events */ - return MSI_SetTargetPathW(package, argument, path); + r = MSI_SetTargetPathW(package, argument, path); + HeapFree(GetProcessHeap(),0,path); + return r; } /* diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index e78b32827ad..115f03ceb46 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -276,6 +276,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, path = build_directory_name(2, check_path, NULL); if (strcmpiW(path,check_path)!=0) MSI_SetPropertyW(package,cszTargetDir,path); + HeapFree(GetProcessHeap(),0,check_path); } else {