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

Fix a potential NULL-pointer dereference following an OOM error

in the query planner logic for virtual tables with OR-connected terms.

FossilOrigin-Name: 71b6c26053fdf2a5a84116e005bad1f2ca873a66
This commit is contained in:
drh
2013-02-08 23:18:18 +00:00
parent 3667033bfc
commit 5edf8435d3
3 changed files with 9 additions and 8 deletions

View File

@@ -3665,7 +3665,8 @@ static void bestIndex(WhereBestIdx *p){
sqlite3_index_info *pIdxInfo = 0;
p->ppIdxInfo = &pIdxInfo;
bestVirtualIndex(p);
if( pIdxInfo->needToFreeIdxStr ){
assert( pIdxInfo!=0 || p->pParse->db->mallocFailed );
if( pIdxInfo && pIdxInfo->needToFreeIdxStr ){
sqlite3_free(pIdxInfo->idxStr);
}
sqlite3DbFree(p->pParse->db, pIdxInfo);