diff options
author | danielk1977 <danielk1977@noemail.net> | 2005-12-09 14:25:08 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2005-12-09 14:25:08 +0000 |
commit | 2e588c7525a77b3a6cc53c67ea833f75f7e4052b (patch) | |
tree | ddcc123e58fd8bd9667533bdfe9b3926bd132cce /src/os_unix.c | |
parent | fde4a6f8a4e8f6edcc3ab6d3c658d42d704060c9 (diff) | |
download | sqlite-2e588c7525a77b3a6cc53c67ea833f75f7e4052b.tar.gz sqlite-2e588c7525a77b3a6cc53c67ea833f75f7e4052b.zip |
Many small changes to ensure memory is not leaked after malloc() fails. (CVS 2808)
FossilOrigin-Name: 601c335463aaabc2e9918e4b9298cff6161be5c4
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 3beaf3b91..c07a80cb9 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -633,6 +633,7 @@ static int unixOpenReadWrite( static int unixOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){ int rc; unixFile f; + int fd; assert( 0==*pId ); if( access(zFilename, 0)==0 ){ @@ -1485,6 +1486,8 @@ static int allocateUnixFile(unixFile *pInit, OsFile **pId){ pNew = sqliteMalloc( sizeof(unixFile) ); if( pNew==0 ){ close(pInit->h); + releaseLockInfo(pInit->pLock); + releaseOpenCnt(pInit->pOpen); *pId = 0; return SQLITE_NOMEM; }else{ |