mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-06 08:21:01 +03:00
Fix some memory leaks and crashes that could follow an OOM condition during WITH clause parsing.
FossilOrigin-Name: 8839850c44a8938883e493eacd752fa686e542df
This commit is contained in:
@@ -4234,12 +4234,13 @@ With *sqlite3WithAdd(
|
||||
pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
|
||||
}
|
||||
assert( zName!=0 || pNew==0 );
|
||||
assert( db->mallocFailed==0 || pNew==0 );
|
||||
|
||||
if( pNew==0 ){
|
||||
sqlite3WithDelete(db, pWith);
|
||||
sqlite3ExprListDelete(db, pArglist);
|
||||
sqlite3SelectDelete(db, pQuery);
|
||||
sqlite3DbFree(db, zName);
|
||||
pNew = pWith;
|
||||
}else{
|
||||
pNew->a[pNew->nCte].pSelect = pQuery;
|
||||
pNew->a[pNew->nCte].pCols = pArglist;
|
||||
|
||||
Reference in New Issue
Block a user