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

Avoid leaking a file descriptor after a malloc failure on unix. (CVS 4518)

FossilOrigin-Name: c249d5da721b32f6fe409a5b55a5d49a58994fec
This commit is contained in:
danielk1977
2007-10-30 17:28:51 +00:00
parent 5f0f253315
commit 7c055b9b7c
3 changed files with 8 additions and 7 deletions

View File

@@ -2268,6 +2268,7 @@ static int fillInUnixFile(
rc = findLockInfo(h, &pNew->pLock, &pNew->pOpen);
leaveMutex();
if( rc ){
if( dirfd>=0 ) close(dirfd);
close(h);
return SQLITE_NOMEM;
}