From: danielk1977 Date: Mon, 30 Jun 2008 10:16:04 +0000 (+0000) Subject: Fix a malloc() failure related problem in os_unix.c. (CVS 5328) X-Git-Tag: version-3.6.10~849 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cb427f5c4af9b526d21327341374c5eea1e632e;p=thirdparty%2Fsqlite.git Fix a malloc() failure related problem in os_unix.c. (CVS 5328) FossilOrigin-Name: ba8819a6f3dbc45d88346789de42971aacc0d246 --- diff --git a/manifest b/manifest index 4dbf17ca04..b330f34018 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\scouple\sof\stests\sto\ssee\sif\sthe\snew\scompound\sselect\soptimizations\swork\swhen\sthe\scompound\sselect\sis\shidden\sinside\sa\sview.\s(CVS\s5327) -D 2008-06-30T07:53:10 +C Fix\sa\smalloc()\sfailure\srelated\sproblem\sin\sos_unix.c.\s(CVS\s5328) +D 2008-06-30T10:16:05 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 325dfac0a0dd1cb4d975f1ace6453157892e6042 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -131,7 +131,7 @@ F src/os.c 292b3b4a49fe5bf6cf2f1cf0af186ebd334e80b8 F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_os2.c 38fd8cfb1c122c39e451d9f3e779c602283dba33 -F src/os_unix.c 715e702be9229d1285e98bf3f5e05da50b4a48e8 +F src/os_unix.c 3d19f0491e0b32e5b757c7e6f310f2f6d3aea3f4 F src/os_win.c 2bf2f8cd700299564cc236262c2668e1e02c626a F src/pager.c e2a49872f1e15eb83895ace704c48ac8ded998ba F src/pager.h 6aa3050a3c684475a5a9dbad5ff1cebad612acba @@ -595,7 +595,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P f66491ab2ba3645d4e44e33ec6fa0ab94b2989be -R 611ba85a3e5544f4f674bd15a237607d +P 1a711249c25aafbaf08057ffdcbb9cf2f872f13d +R c8878f1758bd99bd85efdf3716dd1356 U danielk1977 -Z 1eba408b59726db78885f41885acd9e1 +Z c7f565849ca23e8adcec51fdeb05acd5 diff --git a/manifest.uuid b/manifest.uuid index ad8f2cd688..fb60787c40 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1a711249c25aafbaf08057ffdcbb9cf2f872f13d \ No newline at end of file +ba8819a6f3dbc45d88346789de42971aacc0d246 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 1b93b792a9..45550951f9 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -12,7 +12,7 @@ ** ** This file contains code that is specific to Unix systems. ** -** $Id: os_unix.c,v 1.191 2008/06/28 11:23:00 danielk1977 Exp $ +** $Id: os_unix.c,v 1.192 2008/06/30 10:16:05 danielk1977 Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_UNIX /* This file is used on unix only */ @@ -1463,7 +1463,7 @@ static int unixClose(sqlite3_file *id){ unixFile *pFile = (unixFile *)id; unixUnlock(id, NO_LOCK); enterMutex(); - if( pFile->pOpen->nLock ){ + if( pFile->pOpen && pFile->pOpen->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file ** descriptor to pOpen->aPending. It will be automatically closed when @@ -2095,7 +2095,6 @@ static int fillInUnixFile( assert(LOCKING_STYLE_NONE==4); assert(LOCKING_STYLE_AFP==5); eLockingStyle = detectLockingStyle(pVfs, zFilename, h); - pNew->pMethod = &aIoMethod[eLockingStyle-1]; switch( eLockingStyle ){ @@ -2152,6 +2151,7 @@ static int fillInUnixFile( if( dirfd>=0 ) close(dirfd); close(h); }else{ + pNew->pMethod = &aIoMethod[eLockingStyle-1]; OpenCounter(+1); } return rc;