mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 17:43:44 +00:00
msi: Fix a couple of memory leaks (Valgrind).
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5277aa8f64
commit
1cb4367763
3 changed files with 9 additions and 4 deletions
|
@ -411,8 +411,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
|
||||||
UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
|
UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
|
||||||
{
|
{
|
||||||
MSIPACKAGE *package;
|
MSIPACKAGE *package;
|
||||||
const WCHAR *path;
|
WCHAR *path, *folderW;
|
||||||
WCHAR *folderW;
|
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
TRACE("%s %p %p\n", debugstr_a(folder), buf, sz);
|
TRACE("%s %p %p\n", debugstr_a(folder), buf, sz);
|
||||||
|
@ -459,6 +458,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
|
||||||
else
|
else
|
||||||
r = ERROR_DIRECTORY;
|
r = ERROR_DIRECTORY;
|
||||||
|
|
||||||
|
heap_free(path);
|
||||||
heap_free(folderW);
|
heap_free(folderW);
|
||||||
msiobj_release(&package->hdr);
|
msiobj_release(&package->hdr);
|
||||||
return r;
|
return r;
|
||||||
|
@ -470,7 +470,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
|
||||||
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
|
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
|
||||||
{
|
{
|
||||||
MSIPACKAGE *package;
|
MSIPACKAGE *package;
|
||||||
const WCHAR *path;
|
WCHAR *path;
|
||||||
UINT r;
|
UINT r;
|
||||||
|
|
||||||
TRACE("%s %p %p\n", debugstr_w(folder), buf, sz);
|
TRACE("%s %p %p\n", debugstr_w(folder), buf, sz);
|
||||||
|
@ -510,6 +510,7 @@ UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf,
|
||||||
else
|
else
|
||||||
r = ERROR_DIRECTORY;
|
r = ERROR_DIRECTORY;
|
||||||
|
|
||||||
|
heap_free(path);
|
||||||
msiobj_release(&package->hdr);
|
msiobj_release(&package->hdr);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2125,6 +2125,7 @@ INT WINAPI MsiProcessMessage( MSIHANDLE hInstall, INSTALLMESSAGE eMessageType,
|
||||||
|
|
||||||
ret = MSI_ProcessMessage( package, eMessageType, record );
|
ret = MSI_ProcessMessage( package, eMessageType, record );
|
||||||
|
|
||||||
|
msiobj_release( &record->hdr );
|
||||||
msiobj_release( &package->hdr );
|
msiobj_release( &package->hdr );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2689,7 +2690,10 @@ UINT __cdecl s_remote_FormatRecord(MSIHANDLE hinst, struct wire_record *remote_r
|
||||||
{
|
{
|
||||||
*value = midl_user_allocate(++size * sizeof(WCHAR));
|
*value = midl_user_allocate(++size * sizeof(WCHAR));
|
||||||
if (!*value)
|
if (!*value)
|
||||||
|
{
|
||||||
|
MsiCloseHandle(rec);
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
r = MsiFormatRecordW(hinst, rec, *value, &size);
|
r = MsiFormatRecordW(hinst, rec, *value, &size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,9 @@ static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, U
|
||||||
|
|
||||||
old = sv->db->streams[row].stream;
|
old = sv->db->streams[row].stream;
|
||||||
hr = IStream_QueryInterface( new, &IID_IStream, (void **)&sv->db->streams[row].stream );
|
hr = IStream_QueryInterface( new, &IID_IStream, (void **)&sv->db->streams[row].stream );
|
||||||
|
IStream_Release( new );
|
||||||
if (FAILED( hr ))
|
if (FAILED( hr ))
|
||||||
{
|
{
|
||||||
IStream_Release( new );
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
}
|
}
|
||||||
if (old) IStream_Release( old );
|
if (old) IStream_Release( old );
|
||||||
|
|
Loading…
Reference in a new issue