1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-09 10:21:35 +03:00

Avoid leaking Index.aiRowEst memory if an OOM causes a rollback which deletes

the index before the aiRowEst deletion code in sqlite3AnalysisLoad() routine
has a chance to run.  Since the aiRowEst now might be deleted from freeIndex()
which does not always have a db pointer, make sure the aiRowEst memory is
not held in lookaside.

FossilOrigin-Name: efd87ba142723ba131fcc985db6eb45c5a3c637b
This commit is contained in:
drh
2014-10-04 00:07:44 +00:00
parent 0c1a18b294
commit 75b170b164
4 changed files with 16 additions and 12 deletions

View File

@@ -435,6 +435,9 @@ static void freeIndex(sqlite3 *db, Index *p){
sqlite3ExprDelete(db, p->pPartIdxWhere);
sqlite3DbFree(db, p->zColAff);
if( p->isResized ) sqlite3DbFree(db, p->azColl);
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
sqlite3_free(p->aiRowEst);
#endif
sqlite3DbFree(db, p);
}