Commit 9fe94da2 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

Add missing HeapFree's (found by smatch).

parent 25b6493a
...@@ -699,7 +699,8 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuf ...@@ -699,7 +699,8 @@ UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuf
goto end; goto end;
MultiByteToWideChar( CP_ACP, 0, szAttribute, -1, szwAttribute, len ); MultiByteToWideChar( CP_ACP, 0, szAttribute, -1, szwAttribute, len );
} else { } else {
return ERROR_INVALID_PARAMETER; hr = ERROR_INVALID_PARAMETER;
goto end;
} }
if( szBuffer ) if( szBuffer )
...@@ -1263,7 +1264,10 @@ INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent, ...@@ -1263,7 +1264,10 @@ INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent,
len = MultiByteToWideChar( CP_ACP, 0, szComponent, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, szComponent, -1, NULL, 0 );
szwComponent= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); szwComponent= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwComponent) if( !szwComponent)
{
HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
}
MultiByteToWideChar( CP_ACP, 0, szComponent, -1, szwComponent, len ); MultiByteToWideChar( CP_ACP, 0, szComponent, -1, szwComponent, len );
} }
...@@ -1316,7 +1320,10 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature) ...@@ -1316,7 +1320,10 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateA(LPCSTR szProduct, LPCSTR szFeature)
len = MultiByteToWideChar( CP_ACP, 0, szFeature, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, szFeature, -1, NULL, 0 );
szwFeature= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); szwFeature= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwFeature) if( !szwFeature)
{
HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
}
MultiByteToWideChar( CP_ACP, 0, szFeature, -1, szwFeature, len ); MultiByteToWideChar( CP_ACP, 0, szFeature, -1, szwFeature, len );
} }
...@@ -1353,13 +1360,19 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf, DWORD* pcc ...@@ -1353,13 +1360,19 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf, DWORD* pcc
if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) { if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
lpwVersionBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR)); lpwVersionBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwVersionBuff) if( !lpwVersionBuff)
return ERROR_OUTOFMEMORY; {
ret = ERROR_OUTOFMEMORY;
goto end;
}
} }
if(lpLangBuf && pcchLangBuf && *pcchLangBuf) { if(lpLangBuf && pcchLangBuf && *pcchLangBuf) {
lpwLangBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR)); lpwLangBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwLangBuff) if( !lpwLangBuff)
return ERROR_OUTOFMEMORY; {
ret = ERROR_OUTOFMEMORY;
goto end;
}
} }
ret = MsiGetFileVersionW(szwFilePath, lpwVersionBuff, pcchVersionBuf, lpwLangBuff, pcchLangBuf); ret = MsiGetFileVersionW(szwFilePath, lpwVersionBuff, pcchVersionBuf, lpwLangBuff, pcchLangBuf);
...@@ -1369,6 +1382,7 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf, DWORD* pcc ...@@ -1369,6 +1382,7 @@ UINT WINAPI MsiGetFileVersionA(LPCSTR szFilePath, LPSTR lpVersionBuf, DWORD* pcc
if(lpwLangBuff) if(lpwLangBuff)
WideCharToMultiByte(CP_ACP, 0, lpwLangBuff, -1, lpLangBuf, *pcchLangBuf, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, lpwLangBuff, -1, lpLangBuf, *pcchLangBuf, NULL, NULL);
end:
if(szwFilePath) HeapFree(GetProcessHeap(), 0, szwFilePath); if(szwFilePath) HeapFree(GetProcessHeap(), 0, szwFilePath);
if(lpwVersionBuff) HeapFree(GetProcessHeap(), 0, lpwVersionBuff); if(lpwVersionBuff) HeapFree(GetProcessHeap(), 0, lpwVersionBuff);
if(lpwLangBuff) HeapFree(GetProcessHeap(), 0, lpwLangBuff); if(lpwLangBuff) HeapFree(GetProcessHeap(), 0, lpwLangBuff);
......
...@@ -121,6 +121,7 @@ UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, ...@@ -121,6 +121,7 @@ UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb,
r = MsiDatabaseOpenViewW( hdb, szwQuery, phView); r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
HeapFree( GetProcessHeap(), 0, szwQuery );
return r; return r;
} }
......
...@@ -1203,7 +1203,10 @@ UINT TABLE_insert_row( struct tagMSIVIEW *view, UINT *num ) ...@@ -1203,7 +1203,10 @@ UINT TABLE_insert_row( struct tagMSIVIEW *view, UINT *num )
else else
p = HeapAlloc( GetProcessHeap(), 0, sz ); p = HeapAlloc( GetProcessHeap(), 0, sz );
if( !p ) if( !p )
{
HeapFree( GetProcessHeap(), 0, row );
return ERROR_NOT_ENOUGH_MEMORY; return ERROR_NOT_ENOUGH_MEMORY;
}
tv->table->data = p; tv->table->data = p;
tv->table->data[tv->table->row_count] = row; tv->table->data[tv->table->row_count] = row;
......
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