From: drh Date: Sun, 21 Aug 2005 21:45:01 +0000 (+0000) Subject: Clean up possible locking problem in multithreaded applications that take X-Git-Tag: version-3.6.10~3548 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad81e87054a421ea8662d873c5d9e59b021aabd7;p=thirdparty%2Fsqlite.git Clean up possible locking problem in multithreaded applications that take a malloc failure. (CVS 2611) FossilOrigin-Name: 545e702a23c7a6b09e10441d4137efe5a9618a84 --- diff --git a/manifest b/manifest index ec3863ab6e..15955ae49d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Version\s3.2.3\s(CVS\s2610) -D 2005-08-21T18:54:49 +C Clean\sup\spossible\slocking\sproblem\sin\smultithreaded\sapplications\sthat\stake\na\smalloc\sfailure.\s(CVS\s2611) +D 2005-08-21T21:45:02 F Makefile.in b109ddb46a5550d0732dcd6caca01c123f6d5cdd F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -52,7 +52,7 @@ F src/os.h c4b34bd4d6fea51a420f337468b907f4edecb161 F src/os_common.h 0e7f428ba0a6c40a61bc56c4e96f493231301b73 F src/os_test.c 91e5f22dd89491e5e1554820e715805f43fa4ece F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 535cd82c2fa0b8c4ae9364edeb1ec5342887417e +F src/os_unix.c 7fae44e25c6137340b786b83ecb29db6ba525a64 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c fe7b99cfcfb61d9bf54493ddf5857885a657fb89 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b @@ -297,7 +297,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P b15ed7db4d5186d8b22c0b51cd44c4d9d7001318 -R e7f0677036a899d63bb98ed10f0a20ee +P f620319b440dab9f8a0ad9ada3e6ee5560d5c623 +R 786733587c9d8ff49df3eea18a3edbc8 U drh -Z a4d6591dd0d326889bceaf0178d782d9 +Z 0391af5b4eaaabac70a9de3fdd30f9cb diff --git a/manifest.uuid b/manifest.uuid index c38ff1b3ad..c1b9b802f8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f620319b440dab9f8a0ad9ada3e6ee5560d5c623 \ No newline at end of file +545e702a23c7a6b09e10441d4137efe5a9618a84 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index a19ba4920b..2ea9aa8e35 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1278,13 +1278,13 @@ int sqlite3OsClose(OsFile *id){ */ int *aNew; struct openCnt *pOpen = id->pOpen; - pOpen->nPending++; - aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) ); + aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) ); if( aNew==0 ){ /* If a malloc fails, just leak the file descriptor */ }else{ pOpen->aPending = aNew; - pOpen->aPending[pOpen->nPending-1] = id->h; + pOpen->aPending[pOpen->nPending] = id->h; + pOpen->nPending++; } }else{ /* There are no outstanding locks so we can close the file immediately */