Commit fcbc5cc5 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

msi: Fix a couple of leaks (coverity).

parent 37419c4a
...@@ -336,7 +336,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) ...@@ -336,7 +336,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc); 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; if (!file->Component->Enabled) continue;
...@@ -513,7 +514,8 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) ...@@ -513,7 +514,8 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc); 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 ); comp->Action = msi_get_component_action( package, comp );
if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue; if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue;
......
...@@ -1567,13 +1567,17 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) ...@@ -1567,13 +1567,17 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
{ {
r = msi_create_empty_local_file( localfile, dotmsi ); r = msi_create_empty_local_file( localfile, dotmsi );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
{
msi_free ( base_url );
return r; return r;
}
if (!CopyFileW( file, localfile, FALSE )) if (!CopyFileW( file, localfile, FALSE ))
{ {
r = GetLastError(); r = GetLastError();
WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r); WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
DeleteFileW( localfile ); DeleteFileW( localfile );
msi_free ( base_url );
return r; return r;
} }
delete_on_close = TRUE; delete_on_close = TRUE;
...@@ -1581,7 +1585,10 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) ...@@ -1581,7 +1585,10 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
TRACE("opening package %s\n", debugstr_w( localfile )); TRACE("opening package %s\n", debugstr_w( localfile ));
r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db ); r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
if (r != ERROR_SUCCESS) if (r != ERROR_SUCCESS)
{
msi_free ( base_url );
return r; return r;
}
} }
package = MSI_CreatePackage( db, base_url ); package = MSI_CreatePackage( db, base_url );
msi_free( base_url ); msi_free( base_url );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment