mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix a couple of errors in WAL code that can occur in an OOM situation.
FossilOrigin-Name: 9d3f3736be42ef8ab48b099d4712e08dfca97873
This commit is contained in:
@@ -4972,8 +4972,8 @@ static int unixShmOpen(
|
||||
nName = strlen(zName);
|
||||
pNew = sqlite3_malloc( sizeof(*pFile) + nName + 10 );
|
||||
if( pNew==0 ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto shm_open_err;
|
||||
sqlite3_free(p);
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
memset(pNew, 0, sizeof(*pNew));
|
||||
pNew->zFilename = (char*)&pNew[1];
|
||||
@@ -5059,9 +5059,8 @@ static int unixShmOpen(
|
||||
|
||||
/* Jump here on any error */
|
||||
shm_open_err:
|
||||
unixShmPurge();
|
||||
unixShmPurge(); /* This call frees pFile if required */
|
||||
sqlite3_free(p);
|
||||
sqlite3_free(pFile);
|
||||
sqlite3_free(pNew);
|
||||
*pShm = 0;
|
||||
unixLeaveMutex();
|
||||
|
||||
Reference in New Issue
Block a user