aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-03-03 03:42:31 +0000
committerdrh <drh@noemail.net>2002-03-03 03:42:31 +0000
commit75148a27b4da71f01de20279627405563eabe33f (patch)
tree1710ed441e4968a5816577ed969675b072f9807c /src/expr.c
parentc0a165b304ff012b31ae145a2206d8948288c18b (diff)
downloadsqlite-75148a27b4da71f01de20279627405563eabe33f.tar.gz
sqlite-75148a27b4da71f01de20279627405563eabe33f.zip
Fix a memory leak in expression processing. (CVS 414)
FossilOrigin-Name: dfe431c9b70bc3a1bf5148826edce0846737e66b
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c
index 46c56b57f..d48718823 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.52 2002/03/02 17:04:08 drh Exp $
+** $Id: expr.c,v 1.53 2002/03/03 03:42:31 drh Exp $
*/
#include "sqliteInt.h"
@@ -85,10 +85,8 @@ Expr *sqliteExprFunction(ExprList *pList, Token *pToken){
*/
void sqliteExprDelete(Expr *p){
if( p==0 ) return;
- if( p->op!=TK_AS ){
- if( p->pLeft ) sqliteExprDelete(p->pLeft);
- if( p->pRight ) sqliteExprDelete(p->pRight);
- }
+ if( p->pLeft ) sqliteExprDelete(p->pLeft);
+ if( p->pRight ) sqliteExprDelete(p->pRight);
if( p->pList ) sqliteExprListDelete(p->pList);
if( p->pSelect ) sqliteSelectDelete(p->pSelect);
sqliteFree(p);
@@ -409,7 +407,7 @@ int sqliteExprResolveIds(
assert( pExpr->pLeft==0 && pExpr->pRight==0 );
pExpr->op = TK_AS;
pExpr->iColumn = j;
- pExpr->pLeft = pEList->a[j].pExpr;
+ pExpr->pLeft = sqliteExprDup(pEList->a[j].pExpr);
}
}
}