diff options
author | drh <drh@noemail.net> | 2002-08-25 18:29:11 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2002-08-25 18:29:11 +0000 |
commit | d94a66989474da2fb8c3d848b68a941d0876f9ff (patch) | |
tree | bb0e84bcdccd23d7a0bdfcc451d4355082245681 /src/select.c | |
parent | 4b59ab5e643009b42d6d3efb57c463c8d1123ad6 (diff) | |
download | sqlite-d94a66989474da2fb8c3d848b68a941d0876f9ff.tar.gz sqlite-d94a66989474da2fb8c3d848b68a941d0876f9ff.zip |
Fix the memory leak introduced by check-in (725). (CVS 726)
FossilOrigin-Name: b957dafc26383af514795df18bc7b8f367c9bd21
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index 2171ead1b..73d766227 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.108 2002/08/24 18:24:54 drh Exp $ +** $Id: select.c,v 1.109 2002/08/25 18:29:12 drh Exp $ */ #include "sqliteInt.h" @@ -808,6 +808,7 @@ static int fillInColumnList(Parse *pParse, Select *p){ if( sqliteViewGetColumnNames(pParse, pTab) ){ return 1; } + sqliteSelectDelete(pTabList->a[i].pSelect); pTabList->a[i].pSelect = sqliteSelectDup(pTab->pSelect); } } @@ -1309,8 +1310,11 @@ static void substExpr(Expr *pExpr, int iTable, ExprList *pEList, int iSub){ pNew = pEList->a[pExpr->iColumn].pExpr; assert( pNew!=0 ); pExpr->op = pNew->op; + assert( pExpr->pLeft==0 ); pExpr->pLeft = sqliteExprDup(pNew->pLeft); + assert( pExpr->pRight==0 ); pExpr->pRight = sqliteExprDup(pNew->pRight); + assert( pExpr->pList==0 ); pExpr->pList = sqliteExprListDup(pNew->pList); pExpr->iTable = pNew->iTable; pExpr->iColumn = pNew->iColumn; @@ -1495,6 +1499,7 @@ int flattenSubquery(Select *p, int iFrom, int isAgg, int subqueryIsAgg){ } pSrc->a[iFrom].pTab = pSubSrc->a[0].pTab; pSubSrc->a[0].pTab = 0; + assert( pSrc->a[iFrom].pSelect==pSub ); pSrc->a[iFrom].pSelect = pSubSrc->a[0].pSelect; pSubSrc->a[0].pSelect = 0; sqliteSelectDelete(pSub); |