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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user