1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Clean up possible locking problem in multithreaded applications that take

a malloc failure. (CVS 2611)

FossilOrigin-Name: 545e702a23c7a6b09e10441d4137efe5a9618a84
This commit is contained in:
drh
2005-08-21 21:45:01 +00:00
parent 03e7954732
commit ad81e87054
3 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
C Version\s3.2.3\s(CVS\s2610) C Clean\sup\spossible\slocking\sproblem\sin\smultithreaded\sapplications\sthat\stake\na\smalloc\sfailure.\s(CVS\s2611)
D 2005-08-21T18:54:49 D 2005-08-21T21:45:02
F Makefile.in b109ddb46a5550d0732dcd6caca01c123f6d5cdd F Makefile.in b109ddb46a5550d0732dcd6caca01c123f6d5cdd
F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -52,7 +52,7 @@ F src/os.h c4b34bd4d6fea51a420f337468b907f4edecb161
F src/os_common.h 0e7f428ba0a6c40a61bc56c4e96f493231301b73 F src/os_common.h 0e7f428ba0a6c40a61bc56c4e96f493231301b73
F src/os_test.c 91e5f22dd89491e5e1554820e715805f43fa4ece F src/os_test.c 91e5f22dd89491e5e1554820e715805f43fa4ece
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 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_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c fe7b99cfcfb61d9bf54493ddf5857885a657fb89 F src/os_win.c fe7b99cfcfb61d9bf54493ddf5857885a657fb89
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
@@ -297,7 +297,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P b15ed7db4d5186d8b22c0b51cd44c4d9d7001318 P f620319b440dab9f8a0ad9ada3e6ee5560d5c623
R e7f0677036a899d63bb98ed10f0a20ee R 786733587c9d8ff49df3eea18a3edbc8
U drh U drh
Z a4d6591dd0d326889bceaf0178d782d9 Z 0391af5b4eaaabac70a9de3fdd30f9cb

View File

@@ -1 +1 @@
f620319b440dab9f8a0ad9ada3e6ee5560d5c623 545e702a23c7a6b09e10441d4137efe5a9618a84

View File

@@ -1278,13 +1278,13 @@ int sqlite3OsClose(OsFile *id){
*/ */
int *aNew; int *aNew;
struct openCnt *pOpen = id->pOpen; struct openCnt *pOpen = id->pOpen;
pOpen->nPending++; aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) );
aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) );
if( aNew==0 ){ if( aNew==0 ){
/* If a malloc fails, just leak the file descriptor */ /* If a malloc fails, just leak the file descriptor */
}else{ }else{
pOpen->aPending = aNew; pOpen->aPending = aNew;
pOpen->aPending[pOpen->nPending-1] = id->h; pOpen->aPending[pOpen->nPending] = id->h;
pOpen->nPending++;
} }
}else{ }else{
/* There are no outstanding locks so we can close the file immediately */ /* There are no outstanding locks so we can close the file immediately */