1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-25 20:58:26 +03:00

Many small changes to ensure memory is not leaked after malloc() fails. (CVS 2808)

FossilOrigin-Name: 601c335463aaabc2e9918e4b9298cff6161be5c4
This commit is contained in:
danielk1977
2005-12-09 14:25:08 +00:00
parent fde4a6f8a4
commit 2e588c7525
18 changed files with 848 additions and 423 deletions

View File

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