msi: Fix leaks in ITERATE_InstallService (coverity)
Frédéric Delanoy
frederic.delanoy at gmail.com
Fri Nov 16 04:50:28 CST 2012
CIDs 716414-716421
---
dlls/msi/action.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 935b15f..abc8d02 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -5752,6 +5752,7 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
LPWSTR depends = NULL, pass = NULL, args = NULL, image_path = NULL;
DWORD serv_type, start_type, err_control;
SERVICE_DESCRIPTIONW sd = {NULL};
+ UINT ret = ERROR_SUCCESS;
comp = MSI_RecordGetString( rec, 12 );
component = msi_get_loaded_component( package, comp );
@@ -5809,7 +5810,10 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
{
int len = strlenW(file->TargetPath) + strlenW(args) + 2;
if (!(image_path = msi_alloc(len * sizeof(WCHAR))))
- return ERROR_OUTOFMEMORY;
+ {
+ ret = ERROR_OUTOFMEMORY;
+ goto done;
+ }
strcpyW(image_path, file->TargetPath);
strcatW(image_path, szSpace);
@@ -5843,7 +5847,7 @@ done:
msi_free(depends);
msi_free(args);
- return ERROR_SUCCESS;
+ return ret;
}
static UINT ACTION_InstallServices( MSIPACKAGE *package )
--
1.8.0
More information about the wine-patches
mailing list