1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix a malloc() failure related problem in os_unix.c. (CVS 5328)

FossilOrigin-Name: ba8819a6f3dbc45d88346789de42971aacc0d246
This commit is contained in:
danielk1977
2008-06-30 10:16:04 +00:00
parent 7a8097b6d8
commit 6cb427f5c4
3 changed files with 10 additions and 10 deletions

View File

@@ -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) C Fix\sa\smalloc()\sfailure\srelated\sproblem\sin\sos_unix.c.\s(CVS\s5328)
D 2008-06-30T07:53:10 D 2008-06-30T10:16:05
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 325dfac0a0dd1cb4d975f1ace6453157892e6042 F Makefile.in 325dfac0a0dd1cb4d975f1ace6453157892e6042
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -131,7 +131,7 @@ F src/os.c 292b3b4a49fe5bf6cf2f1cf0af186ebd334e80b8
F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892 F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c 38fd8cfb1c122c39e451d9f3e779c602283dba33 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/os_win.c 2bf2f8cd700299564cc236262c2668e1e02c626a
F src/pager.c e2a49872f1e15eb83895ace704c48ac8ded998ba F src/pager.c e2a49872f1e15eb83895ace704c48ac8ded998ba
F src/pager.h 6aa3050a3c684475a5a9dbad5ff1cebad612acba F src/pager.h 6aa3050a3c684475a5a9dbad5ff1cebad612acba
@@ -595,7 +595,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P f66491ab2ba3645d4e44e33ec6fa0ab94b2989be P 1a711249c25aafbaf08057ffdcbb9cf2f872f13d
R 611ba85a3e5544f4f674bd15a237607d R c8878f1758bd99bd85efdf3716dd1356
U danielk1977 U danielk1977
Z 1eba408b59726db78885f41885acd9e1 Z c7f565849ca23e8adcec51fdeb05acd5

View File

@@ -1 +1 @@
1a711249c25aafbaf08057ffdcbb9cf2f872f13d ba8819a6f3dbc45d88346789de42971aacc0d246

View File

@@ -12,7 +12,7 @@
** **
** This file contains code that is specific to Unix systems. ** 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" #include "sqliteInt.h"
#if SQLITE_OS_UNIX /* This file is used on unix only */ #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; unixFile *pFile = (unixFile *)id;
unixUnlock(id, NO_LOCK); unixUnlock(id, NO_LOCK);
enterMutex(); enterMutex();
if( pFile->pOpen->nLock ){ if( pFile->pOpen && pFile->pOpen->nLock ){
/* If there are outstanding locks, do not actually close the file just /* If there are outstanding locks, do not actually close the file just
** yet because that would clear those locks. Instead, add the file ** yet because that would clear those locks. Instead, add the file
** descriptor to pOpen->aPending. It will be automatically closed when ** 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_NONE==4);
assert(LOCKING_STYLE_AFP==5); assert(LOCKING_STYLE_AFP==5);
eLockingStyle = detectLockingStyle(pVfs, zFilename, h); eLockingStyle = detectLockingStyle(pVfs, zFilename, h);
pNew->pMethod = &aIoMethod[eLockingStyle-1];
switch( eLockingStyle ){ switch( eLockingStyle ){
@@ -2152,6 +2151,7 @@ static int fillInUnixFile(
if( dirfd>=0 ) close(dirfd); if( dirfd>=0 ) close(dirfd);
close(h); close(h);
}else{ }else{
pNew->pMethod = &aIoMethod[eLockingStyle-1];
OpenCounter(+1); OpenCounter(+1);
} }
return rc; return rc;