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

Alexandre Julliard julliard at winehq.org
Tue Nov 20 13:52:23 CST 2012


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Fri Nov 16 18:38:02 2012 +0100

msi: Fix a couple of leaks (coverity).

---

 dlls/msi/files.c   |    6 ++++--
 dlls/msi/package.c |    7 +++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 11913ef..d831313 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -336,7 +336,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
         if (rc != ERROR_SUCCESS)
         {
             ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
-            return ERROR_FUNCTION_FAILED;
+            rc = ERROR_FUNCTION_FAILED;
+            goto done;
         }
         if (!file->Component->Enabled) continue;
 
@@ -513,7 +514,8 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
         if (rc != ERROR_SUCCESS)
         {
             ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
-            return ERROR_FUNCTION_FAILED;
+            rc = ERROR_FUNCTION_FAILED;
+            goto done;
         }
         comp->Action = msi_get_component_action( package, comp );
         if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue;
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 015af00..3055175 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1567,13 +1567,17 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
         {
             r = msi_create_empty_local_file( localfile, dotmsi );
             if (r != ERROR_SUCCESS)
+            {
+                msi_free ( base_url );
                 return r;
+            }
 
             if (!CopyFileW( file, localfile, FALSE ))
             {
                 r = GetLastError();
                 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
                 DeleteFileW( localfile );
+                msi_free ( base_url );
                 return r;
             }
             delete_on_close = TRUE;
@@ -1581,7 +1585,10 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
         TRACE("opening package %s\n", debugstr_w( localfile ));
         r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
         if (r != ERROR_SUCCESS)
+        {
+            msi_free ( base_url );
             return r;
+        }
     }
     package = MSI_CreatePackage( db, base_url );
     msi_free( base_url );




More information about the wine-cvs mailing list