msi: Fix some leaks (coverity).

oldstable
Frédéric Delanoy 2012-11-07 01:05:50 +01:00 committed by Alexandre Julliard
parent 82c97d954d
commit 85bf1082ce
4 changed files with 12 additions and 2 deletions

View File

@ -2215,7 +2215,10 @@ UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode,
if (!(val = msi_alloc( sz ))) return ERROR_OUTOFMEMORY;
if ((r = msi_comp_find_prodcode(squished_pc, dwContext, szComponent, val, &sz)))
{
msi_free(val);
return r;
}
if (lstrlenW(val) > 2 &&
val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9' && val[2] != ':')

View File

@ -638,10 +638,12 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
return;
size = GetFileVersionInfoSizeW(fusion, &handle);
if (!size) return;
if (!size)
goto done;
version = msi_alloc(size);
if (!version) return;
if (!version)
goto done;
if (!GetFileVersionInfoW(fusion, handle, size, version))
goto done;

View File

@ -763,7 +763,10 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
r = OpenSourceKey(product, &source, MSICODE_PRODUCT, context, FALSE);
if (r != ERROR_SUCCESS)
{
msi_free(buffer);
return r;
}
sprintfW(buffer, format, typechar, index, value);

View File

@ -1253,6 +1253,8 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
if (r != ERROR_SUCCESS)
{
ERR("can't get table dimensions\n");
table->view->ops->delete(table->view);
msi_free(table);
goto end;
}