diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:59 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:59 -0400 |
| commit | ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (patch) | |
| tree | acdb9a8816483652a9db1a47db71df5df43707c5 /ext/sqlite/libsqlite/src/expr.c | |
| parent | 10f5b47dc7c1cf2b9a00991629f43652710322d3 (diff) | |
| download | php-ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61.tar.gz | |
Imported Upstream version 5.1.1upstream/5.1.1
Diffstat (limited to 'ext/sqlite/libsqlite/src/expr.c')
| -rw-r--r-- | ext/sqlite/libsqlite/src/expr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/sqlite/libsqlite/src/expr.c b/ext/sqlite/libsqlite/src/expr.c index 4339836e8..11d298d69 100644 --- a/ext/sqlite/libsqlite/src/expr.c +++ b/ext/sqlite/libsqlite/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.5 2004/07/10 12:27:51 wez Exp $ +** $Id: expr.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -124,7 +124,7 @@ Expr *sqliteExprDup(Expr *p){ if( pNew==0 ) return 0; memcpy(pNew, p, sizeof(*pNew)); if( p->token.z!=0 ){ - pNew->token.z = sqliteStrDup(p->token.z); + pNew->token.z = sqliteStrNDup(p->token.z, p->token.n); pNew->token.dyn = 1; }else{ assert( pNew->token.z==0 ); @@ -155,7 +155,10 @@ ExprList *sqliteExprListDup(ExprList *p){ if( pNew==0 ) return 0; pNew->nExpr = pNew->nAlloc = p->nExpr; pNew->a = pItem = sqliteMalloc( p->nExpr*sizeof(p->a[0]) ); - if( pItem==0 ) return 0; /* Leaks memory after a malloc failure */ + if( pItem==0 ){ + sqliteFree(pNew); + return 0; + } for(i=0; i<p->nExpr; i++, pItem++){ Expr *pNewExpr, *pOldExpr; pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr); |
