Fix a case in the pager where an xFetch() reference was being leaked following an OOM error.

FossilOrigin-Name: 5885ba6ce768658ec25b60747430d147b315b55c
This commit is contained in:
dan 2013-03-25 13:50:49 +00:00
parent f23da96636
commit a1afc7425a
5 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Replace\sthe\ssqlite3_io_methods.xMremap\sinterface\swith\ssqlite3_io_methods.xFetch\sand\sxUnfetch.
D 2013-03-23T21:00:41.457
C Fix\sa\scase\sin\sthe\spager\swhere\san\sxFetch()\sreference\swas\sbeing\sleaked\sfollowing\san\sOOM\serror.
D 2013-03-25T13:50:49.946
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -160,10 +160,10 @@ F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
F src/os.c a7ec2ddc43fb2684bfd8cb30db15ea6cce3298e9
F src/os.h 782980cd0d840b4240a6e29ba9f8ef0ca0d750ca
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_unix.c d8cdf331ad08650fc8397eee79b55548070077b0
F src/os_unix.c 1e61abcb664f3430ce13e5c5f32b2b2e204a6f23
F src/os_win.c 386f8c034b177b672f7819ddc5d80be6c8d593ac
F src/pager.c 2e63de7185c2a573d26e5087869a9e48326076f9
F src/pager.h faf4bed79e80cb6527209dfe5cfb08aa5764b941
F src/pager.c 3da35f3287791354f170824fd847e75ba9f2a0dc
F src/pager.h 241d72dc0905df042da165f086d03505cb0bb50c
F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222
@ -1039,7 +1039,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
P 60b9f5e4dd2af54975ba78437239f0bebd472fd2
R eee4d88d6400cf65980c5b201532d2c9
P 1431be95579160fb70408d43e17fc23c7b69ab4a
R 2702651dc0367254a02a7905a85901b0
U dan
Z eabd20cdc7aabbc65591f96e4f6dff04
Z 4827c382c08dac8144315d5de3ed2c37

View File

@ -1 +1 @@
1431be95579160fb70408d43e17fc23c7b69ab4a
5885ba6ce768658ec25b60747430d147b315b55c

View File

@ -1807,6 +1807,7 @@ end_unlock:
** the requested locking level, this routine is a no-op.
*/
static int unixUnlock(sqlite3_file *id, int eFileLock){
assert( eFileLock==SHARED_LOCK || ((unixFile *)id)->nFetchOut==0 );
return posixUnlock(id, eFileLock, 0);
}
@ -4531,7 +4532,6 @@ static int unixMapfile(unixFile *pFd, i64 nByte){
}
if( nMap!=pFd->mmapSize ){
void *pNew;
unixUnmapfile(pFd);
if( nMap>0 ){

View File

@ -3870,6 +3870,7 @@ static int pagerAcquireMapPage(
}else{
*ppPage = p = (PgHdr *)sqlite3MallocZero(sizeof(PgHdr) + pPager->nExtra);
if( p==0 ){
sqlite3OsUnfetch(pPager->fd, pData);
return SQLITE_NOMEM;
}
p->pExtra = (void *)&p[1];

View File

@ -174,7 +174,6 @@ int sqlite3SectorSize(sqlite3_file *);
/* Functions used to truncate the database file. */
void sqlite3PagerTruncateImage(Pager*,Pgno);
int sqlite3PagerSetFilesize(Pager *, i64);
#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL)
void *sqlite3PagerCodec(DbPage *);