From: drh Date: Tue, 20 Jul 2004 02:05:11 +0000 (+0000) Subject: Fix an obscure memory leak in the expression list allocator. (CVS 1835) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cf73f61fb2892cbc63a0972d581f8ffef9adbbd;p=thirdparty%2Fsqlite.git Fix an obscure memory leak in the expression list allocator. (CVS 1835) FossilOrigin-Name: 5c77b332bd7704b754edf6876ae668136b05876f --- diff --git a/manifest b/manifest index fdae2e1260..e2b8ac0113 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Handle\squotes\son\stable\snames\sin\sTABLE.*\sterms\sin\sSELECT.\s\sTicket\s#680.\s(CVS\s1834) -D 2004-07-20T01:45:49 +C Fix\san\sobscure\smemory\sleak\sin\sthe\sexpression\slist\sallocator.\s(CVS\s1835) +D 2004-07-20T02:05:11 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -31,7 +31,7 @@ F src/copy.c 750e13828c3e4a293123e36aaa7cf0f22466248a F src/date.c 54befeafe3e2af041c22bcc49fd79f0396b75c4d F src/delete.c 82001c74882319f94dab5f6b92a27311b31092ae F src/encode.c fc8c51f0b61bc803ccdec092e130bebe762b0a2f -F src/expr.c 8c3f5603c3e98b1c146d18076ba3e82cdbb59c11 +F src/expr.c 4ac85257dee28ac1496c5521910ba4020f2bb4f0 F src/func.c ab5c57f0ebb975e66cc13f09141247c2f7a2c293 F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7 @@ -189,7 +189,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 467309975f40bdc1ac0ed1c9c34d187e91217e12 -R b06683a522efc92cf8ccfe4d20bc02a5 +P 9937ffb08e6eb3a11344d880cade9975e8dc9d5b +R 8e9ca8a4e352d998bab73bf6c18657bb U drh -Z 4759a2f5a5b34994f5fc2f5fad5cea05 +Z 30db773930176c25ace2b02b4867ff58 diff --git a/manifest.uuid b/manifest.uuid index 573469810e..55f8bdd27a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9937ffb08e6eb3a11344d880cade9975e8dc9d5b \ No newline at end of file +5c77b332bd7704b754edf6876ae668136b05876f \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index f92dbc078d..364bc5f521 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.114 2004/04/23 17:04:45 drh Exp $ +** $Id: expr.c,v 1.114.2.1 2004/07/20 02:05:11 drh Exp $ */ #include "sqliteInt.h" #include @@ -155,8 +155,7 @@ 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 */ - for(i=0; inExpr; i++, pItem++){ + for(i=0; inExpr && pItem; i++, pItem++){ Expr *pNewExpr, *pOldExpr; pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr); if( pOldExpr->span.z!=0 && pNewExpr ){