Fix crash that occurred when an invalid query string was deleted

twice.
This commit is contained in:
Mike McCormack 2004-06-26 00:18:23 +00:00 committed by Alexandre Julliard
parent f558741fab
commit fb3f40b962
2 changed files with 4 additions and 1 deletions

View File

@ -767,6 +767,7 @@ UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview )
{
if( *sql.view )
(*sql.view)->ops->delete( *sql.view );
*sql.view = NULL;
return ERROR_BAD_QUERY_SYNTAX;
}

View File

@ -295,7 +295,8 @@ static UINT WHERE_delete( struct tagMSIVIEW *view )
wv->reorder = NULL;
wv->row_count = 0;
delete_expr( wv->cond );
if( wv->cond )
delete_expr( wv->cond );
HeapFree( GetProcessHeap(), 0, wv );
@ -340,6 +341,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
wv->table = table;
wv->row_count = 0;
wv->reorder = NULL;
wv->cond = NULL;
*view = (MSIVIEW*) wv;
return ERROR_SUCCESS;