Commit 22a277cc authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Fix some memory leaks.

parent a4b76cee
......@@ -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;
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
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