msi: Fix some memory leaks.

This commit is contained in:
Hans Leidekker 2009-05-28 15:04:17 +02:00 committed by Alexandre Julliard
parent a4b76ceee7
commit 22a277cc2e
6 changed files with 21 additions and 4 deletions

View File

@ -257,8 +257,11 @@ UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_inf
return ERROR_FUNCTION_FAILED;
r = TABLE_CreateView( db, name, &av->table );
if (r != ERROR_SUCCESS || !av->table)
if (r != ERROR_SUCCESS)
{
msi_free( av );
return r;
}
if (colinfo)
colinfo->table = name;

View File

@ -113,8 +113,11 @@ UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
return ERROR_FUNCTION_FAILED;
r = TABLE_CreateView(db, name, &dv->table);
if (r != ERROR_SUCCESS || !dv->table)
if (r != ERROR_SUCCESS)
{
msi_free( dv );
return r;
}
dv->view.ops = &drop_ops;
dv->db = db;

View File

@ -338,7 +338,10 @@ UINT JOIN_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables )
table = msi_alloc(sizeof(JOINTABLE));
if (!table)
return ERROR_OUTOFMEMORY;
{
r = ERROR_OUTOFMEMORY;
goto end;
}
r = TABLE_CreateView( db, tables, &table->view );
if( r != ERROR_SUCCESS )

View File

@ -559,8 +559,10 @@ UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view)
rows = add_storages_to_table(sv);
if (rows < 0)
{
msi_free( sv );
return ERROR_FUNCTION_FAILED;
}
sv->num_rows = rows;
*view = (MSIVIEW *)sv;

View File

@ -523,7 +523,10 @@ UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
sv->db = db;
rows = add_streams_to_table(sv);
if (rows < 0)
{
msi_free( sv );
return ERROR_FUNCTION_FAILED;
}
sv->num_rows = rows;
*view = (MSIVIEW *)sv;

View File

@ -261,7 +261,10 @@ UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
uv = msi_alloc_zero( sizeof *uv );
if( !uv )
{
wv->ops->delete( wv );
return ERROR_FUNCTION_FAILED;
}
/* fill the structure */
uv->view.ops = &update_ops;