From: drh Date: Fri, 30 Mar 2007 18:42:55 +0000 (+0000) Subject: Fix a memory leak in multi-database commit. Also enhance a comment that X-Git-Tag: version-3.6.10~2399 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c416ba97bf6a452e6731a4d1cab234ee316d051b;p=thirdparty%2Fsqlite.git Fix a memory leak in multi-database commit. Also enhance a comment that explains why a particular valgrind error is harmless. (CVS 3771) FossilOrigin-Name: 28c7ed1eb799203a569cdae97da974b347f39579 --- diff --git a/manifest b/manifest index b115ed8680..923f2a9f22 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Coverage\stesting\sfor\sa\sfew\slines\sin\spager.c.\s(CVS\s3770) -D 2007-03-30T18:21:53 +C Fix\sa\smemory\sleak\sin\smulti-database\scommit.\s\sAlso\senhance\sa\scomment\sthat\nexplains\swhy\sa\sparticular\svalgrind\serror\sis\sharmless.\s(CVS\s3771) +D 2007-03-30T18:42:56 F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -123,11 +123,11 @@ F src/update.c 3359041db390a8f856d67272f299600e2104f350 F src/utf.c 67ecb1032bc0b42c105e88d65ef9d9f626eb0e1f F src/util.c 8e8180ee5597f2474c1da311ff3c464b6966c0f1 F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef -F src/vdbe.c d5a4fc1e18af2a2873d022450c4a776f6c17bac3 +F src/vdbe.c 87e31f0790ac8a5aad7b7fcd5b97948943fccba3 F src/vdbe.h 0025259af1939fb264a545816c69e4b5b8d52691 F src/vdbeInt.h 4b19fd8febad3fd14c4c97adaefc06754d323132 F src/vdbeapi.c 7ac14f2e3b2283dcd35f5edefd31a8342cff783c -F src/vdbeaux.c 5efa6d0f6096f213fbdffa0b1bf0a4c8ae40d145 +F src/vdbeaux.c a77bf70260ac1802dccf1076088700cc51d81fa3 F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f F src/vdbemem.c d3696b4b0e5f32272659816cdfa2348c650b1ba0 F src/vtab.c 7fbda947e28cbe7adb3ba752a76ca9ef29936750 @@ -447,7 +447,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P f5fad52a97a16faddc2701ea0e05a301974eda1a -R d7b8a8d5ad13f6c53ffa624952731df2 -U danielk1977 -Z 82a1f92ad94ed1831ca10d2592c97005 +P c1aca18fad35be60066a08f5bd09772d24375af6 +R d3989353f3b76217fb1661204ddd5484 +U drh +Z d9338063531486f14e383e7f3e14d3e3 diff --git a/manifest.uuid b/manifest.uuid index 0a2f053d9b..9174d8578b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c1aca18fad35be60066a08f5bd09772d24375af6 \ No newline at end of file +28c7ed1eb799203a569cdae97da974b347f39579 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index fc4ce51c5b..0a23cd91f9 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.597 2007/03/30 11:23:45 drh Exp $ +** $Id: vdbe.c,v 1.598 2007/03/30 18:42:56 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -3105,7 +3105,9 @@ case OP_NotExists: { /* no-push */ pC->cacheStatus = CACHE_STALE; /* res might be uninitialized if rc!=SQLITE_OK. But if rc!=SQLITE_OK ** processing is about to abort so we really do not care whether or not - ** the following jump is taken. */ + ** the following jump is taken. (In other words, do not stress over + ** the error that valgrind sometimes shows on the next statement when + ** running ioerr.test and similar failure-recovery test scripts.) */ if( res!=0 ){ pc = pOp->p2 - 1; pC->rowidIsValid = 0; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 9befa36f59..1c06d4bf34 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1205,11 +1205,11 @@ static int vdbeCommit(sqlite3 *db){ ** transaction files are deleted. */ rc = sqlite3OsDelete(zMaster); + sqliteFree(zMaster); + zMaster = 0; if( rc ){ return rc; } - sqliteFree(zMaster); - zMaster = 0; rc = sqlite3OsSyncDirectory(zMainFile); if( rc!=SQLITE_OK ){ /* This is not good. The master journal file has been deleted, but