aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index 176115689..92c2ecf8f 100644
--- a/src/select.c
+++ b/src/select.c
@@ -3627,7 +3627,10 @@ static Expr *substExpr(
}
testcase( ExprHasProperty(pCopy, EP_Subquery) );
pNew = sqlite3ExprDup(db, pCopy, 0);
- if( pNew==0 ) return pExpr;
+ if( db->mallocFailed ){
+ sqlite3ExprDelete(db, pNew);
+ return pExpr;
+ }
if( pSubst->isLeftJoin ){
ExprSetProperty(pNew, EP_CanBeNull);
}