mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Ensure that allocateBtreePage() always clears the MemPage pointer when
it fails due to an I/O or memory allocation error. FossilOrigin-Name: 09a38bf665902834936d39341627ded88142e6ae
This commit is contained in:
@@ -5287,8 +5287,7 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
|
||||
** sqlite3PagerUnref() on the new page when it is done.
|
||||
**
|
||||
** SQLITE_OK is returned on success. Any other return value indicates
|
||||
** an error. *ppPage and *pPgno are undefined in the event of an error.
|
||||
** Do not invoke sqlite3PagerUnref() on *ppPage if an error is returned.
|
||||
** an error. *ppPage is set to NULL in the event of an error.
|
||||
**
|
||||
** If the "nearby" parameter is not 0, then an effort is made to
|
||||
** locate a page close to the page number "nearby". This can be used in an
|
||||
@@ -5532,6 +5531,7 @@ static int allocateBtreePage(
|
||||
rc = sqlite3PagerWrite((*ppPage)->pDbPage);
|
||||
if( rc!=SQLITE_OK ){
|
||||
releasePage(*ppPage);
|
||||
*ppPage = 0;
|
||||
}
|
||||
}
|
||||
searchList = 0;
|
||||
|
Reference in New Issue
Block a user