1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Avoid an assertion fault and/or freeing memory while it is still in use when

an error occurs during virtual table construction.

FossilOrigin-Name: a02599ad85d02470c9effa51c02dbda7796bfa16
This commit is contained in:
drh
2012-10-09 14:36:47 +00:00
parent 2f546ee914
commit 5a55826bcd
3 changed files with 8 additions and 9 deletions

View File

@@ -263,9 +263,8 @@ void sqlite3VtabClear(sqlite3 *db, Table *p){
if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p);
if( p->azModuleArg ){
int i;
assert( p->nModuleArg<2 || p->azModuleArg[1]==0 );
for(i=0; i<p->nModuleArg; i++){
sqlite3DbFree(db, p->azModuleArg[i]);
if( i!=1 ) sqlite3DbFree(db, p->azModuleArg[i]);
}
sqlite3DbFree(db, p->azModuleArg);
}