Hans Leidekker : msi: Fix a couple of memory leaks (Coverity).
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jul 15 09:51:24 CDT 2015
Module: wine
Branch: master
Commit: f9dc20cfcc5077f06a572ffc97b47eff07774014
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f9dc20cfcc5077f06a572ffc97b47eff07774014
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Jul 15 15:13:35 2015 +0200
msi: Fix a couple of memory leaks (Coverity).
---
dlls/msi/table.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 700a61a..9c31992 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -809,7 +809,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
/* add each column to the _Columns table */
r = TABLE_CreateView( db, szColumns, &tv );
if( r )
- return r;
+ goto err;
r = tv->ops->execute( tv, 0 );
TRACE("tv execute returned %x\n", r);
@@ -2325,8 +2325,7 @@ err:
}
static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st,
- IStorage *stg,
- const BYTE *rawdata, UINT bytes_per_strref )
+ IStorage *stg, const BYTE *rawdata, UINT bytes_per_strref )
{
UINT i, val, ofs = 0;
USHORT mask;
@@ -2359,12 +2358,14 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
r = msi_record_encoded_stream_name( tv, rec, &encname );
if ( r != ERROR_SUCCESS )
+ {
+ msiobj_release( &rec->hdr );
return NULL;
-
- r = IStorage_OpenStream( stg, encname, NULL,
- STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm );
+ }
+ r = IStorage_OpenStream( stg, encname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm );
if ( r != ERROR_SUCCESS )
{
+ msiobj_release( &rec->hdr );
msi_free( encname );
return NULL;
}
More information about the wine-cvs
mailing list