From: drh Date: Thu, 22 Jul 2004 16:32:13 +0000 (+0000) Subject: Bug fix in allocation of expression lists after a malloc() failure. (CVS 1854) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c3ab2d6ace859b4288f89d3b29d0fb79ec1d974;p=thirdparty%2Fsqlite.git Bug fix in allocation of expression lists after a malloc() failure. (CVS 1854) FossilOrigin-Name: 09494cab4f53a90e0d84abfec6806b4b2b3e118b --- diff --git a/manifest b/manifest index 91dccb58da..835d0dc268 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sjoin\stests\sto\sthe\s2.8\sbranch.\s(CVS\s1850) -D 2004-07-22T16:08:39 +C Bug\sfix\sin\sallocation\sof\sexpression\slists\safter\sa\smalloc()\sfailure.\s(CVS\s1854) +D 2004-07-22T16:32:14 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 4ac85257dee28ac1496c5521910ba4020f2bb4f0 +F src/expr.c b73ba23d007650c470a824b250e89245f6f41048 F src/func.c ab5c57f0ebb975e66cc13f09141247c2f7a2c293 F src/hash.c 9b56ef3b291e25168f630d5643a4264ec011c70e F src/hash.h 3247573ab95b9dd90bcca0307a75d9a16da1ccc7 @@ -191,7 +191,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 9b3c3ca4aff10c7e395d195cd76a1f3c038cb066 -R 2ddf95a9ee2f62de830f29404030a22a +P e5546f49c79155ed2695a1d58ca8044e79d60802 +R 349a82db98b95e9c0e049f81fb8fa677 U drh -Z 1e44afd684f277f761abdf6ace2ba2c9 +Z f227e83bc185134edac495deaace1b23 diff --git a/manifest.uuid b/manifest.uuid index 9bc8163ff7..8d7327a4cc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e5546f49c79155ed2695a1d58ca8044e79d60802 \ No newline at end of file +09494cab4f53a90e0d84abfec6806b4b2b3e118b \ No newline at end of file diff --git a/src/expr.c b/src/expr.c index 364bc5f521..7ea990fbf8 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.2.1 2004/07/20 02:05:11 drh Exp $ +** $Id: expr.c,v 1.114.2.2 2004/07/22 16:32:14 drh Exp $ */ #include "sqliteInt.h" #include @@ -155,7 +155,10 @@ 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]) ); - for(i=0; inExpr && pItem; i++, pItem++){ + if( pItem==0 ){ + return 0; + } + for(i=0; inExpr; i++, pItem++){ Expr *pNewExpr, *pOldExpr; pItem->pExpr = pNewExpr = sqliteExprDup(pOldExpr = p->a[i].pExpr); if( pOldExpr->span.z!=0 && pNewExpr ){