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

@@ -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;