diff options
author | drh <drh@noemail.net> | 2004-08-08 23:39:19 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2004-08-08 23:39:19 +0000 |
commit | 71c697ef4dc8487ba8039fb5a51b013b2b94650a (patch) | |
tree | 60ae526a46a68f1d864bf9579c034158afdadfad /src/expr.c | |
parent | 4c755c0f53b0dda851b356ac2c41db28a73ef591 (diff) | |
download | sqlite-71c697ef4dc8487ba8039fb5a51b013b2b94650a.tar.gz sqlite-71c697ef4dc8487ba8039fb5a51b013b2b94650a.zip |
Fix problems in the handling of malloc failures. (CVS 1882)
FossilOrigin-Name: 81d91d14cf2352fc7981b361ac9af99b3cbbc9e8
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index a01ab8aa3..a77787480 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.154 2004/08/08 20:22:17 drh Exp $ +** $Id: expr.c,v 1.155 2004/08/08 23:39:19 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -226,8 +226,7 @@ Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, Token *pToken){ void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){ assert( pRight!=0 ); assert( pLeft!=0 ); - /* Note: pExpr might be NULL due to a prior malloc failure */ - if( pExpr && pRight->z && pLeft->z ){ + if( !sqlite3_malloc_failed && pRight->z && pLeft->z ){ if( pLeft->dyn==0 && pRight->dyn==0 ){ pExpr->span.z = pLeft->z; pExpr->span.n = pRight->n + Addr(pRight->z) - Addr(pLeft->z); |