]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a malloc() failure related problem in os_unix.c. (CVS 5328)
authordanielk1977 <danielk1977@noemail.net>
Mon, 30 Jun 2008 10:16:04 +0000 (10:16 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 30 Jun 2008 10:16:04 +0000 (10:16 +0000)
FossilOrigin-Name: ba8819a6f3dbc45d88346789de42971aacc0d246

manifest
manifest.uuid
src/os_unix.c

index 4dbf17ca043807badf5db5b29b4515007fc61576..b330f34018ba6c326736a6adfe3ca1460347c6fa 100644 (file)
--- 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
index ad8f2cd688562df9ff79f2b86748351ffba614ce..fb60787c40e1b1f9ac6cfb81309bc904a49957ea 100644 (file)
@@ -1 +1 @@
-1a711249c25aafbaf08057ffdcbb9cf2f872f13d
\ No newline at end of file
+ba8819a6f3dbc45d88346789de42971aacc0d246
\ No newline at end of file
index 1b93b792a986a84cfafad28ea77935462d41e61a..45550951f9730562b6d7b7b35ca8dd14a7d322c8 100644 (file)
@@ -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;