From: drh Date: Tue, 15 Jan 2008 02:22:24 +0000 (+0000) Subject: Fix for a couple of minor memory leaks. (CVS 4712) X-Git-Tag: version-3.6.10~1465 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cc7432280934e1af2a56096274d51799f425869;p=thirdparty%2Fsqlite.git Fix for a couple of minor memory leaks. (CVS 4712) FossilOrigin-Name: a13d3e953f1a3e451e8708a8ef064aa1d72cb4e9 --- diff --git a/manifest b/manifest index bd66558ff1..782a90a30c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sfor\sticket\s#2883.\s(CVS\s4711) -D 2008-01-14T15:20:08 +C Fix\sfor\sa\scouple\sof\sminor\smemory\sleaks.\s(CVS\s4712) +D 2008-01-15T02:22:24 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -131,7 +131,7 @@ F src/pragma.c b4e77e057990bb2c295c63327406d9bcbf6c9c08 F src/prepare.c c31a879d6795f4765fd0b113675c6debbc96b7fd F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910 F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da -F src/select.c 16ba6ec0b3de4971579e66964ba2f25e0b43c78b +F src/select.c 578f7b01047b20349ead5a36d7e64274a61bea80 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c 0691a3d52dc37cf6ac2f74838e5ff8ae1055ac9b F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f @@ -172,7 +172,7 @@ F src/vdbe.c f36700465fe35af303d33d59fef03779d93b2570 F src/vdbe.h a9166e1601f5b74c20516a74182773a20baee43e F src/vdbeInt.h 31bd686595356284d5484592e2dc6e58025aa346 F src/vdbeapi.c cb8c427a3ab646490c83204a98e94eff03ee2e89 -F src/vdbeaux.c ac5d274b175e078eb90b1ad7c8f45419c485e92b +F src/vdbeaux.c 1bf7dbab24af0be35855abd5e4d9c6290e38f4ce F src/vdbeblob.c e386d49d8354aa5a58f0a7f2794303442c149120 F src/vdbefifo.c 334c838c8f42d61a94813d136019ee566b5dc2f6 F src/vdbemem.c a86119b5ccc41ab8653e4746f83d591ff0ae892e @@ -606,7 +606,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 23181f86896e7c9e993e00032e735e67ee6b2e71 -R 57416ebd786a2a3840c925dcabd6419f +P 187f41f54d7cfbaa9f6ce3be4d213a454b600749 +R 94d8fffe25a18201bc94ce39941579d6 U drh -Z da698677dd64357916b70ef21d1f5593 +Z 79adf324172785bd88656a478d418020 diff --git a/manifest.uuid b/manifest.uuid index 868e0b3d88..dddd326d6d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -187f41f54d7cfbaa9f6ce3be4d213a454b600749 \ No newline at end of file +a13d3e953f1a3e451e8708a8ef064aa1d72cb4e9 \ No newline at end of file diff --git a/src/select.c b/src/select.c index fa9f457631..7538494021 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.401 2008/01/13 19:02:11 drh Exp $ +** $Id: select.c,v 1.402 2008/01/15 02:22:24 drh Exp $ */ #include "sqliteInt.h" @@ -3539,11 +3539,10 @@ int sqlite3Select( */ flag = minMaxQuery(pParse, p); if( flag ){ - pMinMax = sqlite3ExprListDup(db, p->pEList->a[0].pExpr->pList); + pDel = pMinMax = sqlite3ExprListDup(db, p->pEList->a[0].pExpr->pList); if( pMinMax && !db->mallocFailed ){ pMinMax->a[0].sortOrder = ((flag==ORDERBY_MIN)?0:1); pMinMax->a[0].pExpr->op = TK_COLUMN; - pDel = pMinMax; } } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 53abc35b21..9d1592fdda 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -582,8 +582,10 @@ void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){ assert( p->nOp>0 || p->aOp==0 ); assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed ); if( p->nOp ){ + char **pz = &p->aOp[p->nOp-1].zComment; va_start(ap, zFormat); - p->aOp[p->nOp-1].zComment = sqlite3VMPrintf(p->db, zFormat, ap); + sqlite3_free(*pz); + *pz = sqlite3VMPrintf(p->db, zFormat, ap); va_end(ap); } }