aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2004-06-15 16:51:01 +0000
committerdanielk1977 <danielk1977@noemail.net>2004-06-15 16:51:01 +0000
commite00484002f41738b12d4736ba5943c9daaae52d9 (patch)
tree577b8e007292cef845a1f0592648ce7abf93e91e /src/expr.c
parentb20e56b451e942803f6e53842dfcf66d44b49648 (diff)
downloadsqlite-e00484002f41738b12d4736ba5943c9daaae52d9.tar.gz
sqlite-e00484002f41738b12d4736ba5943c9daaae52d9.zip
Assorted memory leak fixes. (CVS 1600)
FossilOrigin-Name: 07b90f3690768e852384fbbde0ba59e69e24d1da
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 45401649a..d43eb0dbf 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.141 2004/06/12 09:25:14 danielk1977 Exp $
+** $Id: expr.c,v 1.142 2004/06/15 16:51:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -307,7 +307,10 @@ ExprList *sqlite3ExprListDup(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 = sqlite3ExprDup(pOldExpr = p->a[i].pExpr);