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

Fix a potential memory leak in the VxWorks VFS that can occur following

an OOM or I/O error during xOpen().

FossilOrigin-Name: cb880145d899832cca0612b89024a54d188ed706600fa812ea74587d69c261be
This commit is contained in:
drh
2025-09-08 19:56:14 +00:00
parent 91020438c0
commit 4edee00ee0
3 changed files with 15 additions and 9 deletions

View File

@@ -5982,10 +5982,16 @@ static int fillInUnixFile(
storeLastErrno(pNew, 0);
#if OS_VXWORKS
if( rc!=SQLITE_OK ){
if( h>=0 ) robust_close(pNew, h, __LINE__);
h = -1;
if( h>=0 ){
robust_close(pNew, h, __LINE__);
h = -1;
}
osUnlink(zFilename);
pNew->ctrlFlags |= UNIXFILE_DELETE;
if( pNew->pId ){
vxworksReleaseFileId(pNew->pId);
pNew->pId = 0;
}
}
#endif
if( rc!=SQLITE_OK ){