=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: msi: Fix leaks in ITERATE_InstallService (coverity).

Alexandre Julliard julliard at winehq.org
Fri Nov 16 13:12:52 CST 2012


Module: wine
Branch: master
Commit: 098b3c72941c810a8b4f2712e70654312bba5857
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=098b3c72941c810a8b4f2712e70654312bba5857

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Fri Nov 16 11:50:28 2012 +0100

msi: Fix leaks in ITERATE_InstallService (coverity).

---

 dlls/msi/action.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 2bf0ed5..246b90c 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 )




More information about the wine-cvs mailing list