1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix a reference count problem following database corruption detection in

the ptrmapPut() routine of btree.c. (CVS 6854)

FossilOrigin-Name: ec1e27e33b89e809a03e4140b351f6c8674c0233
This commit is contained in:
drh
2009-07-07 11:39:58 +00:00
parent fa3be90471
commit 4925a55d14
3 changed files with 11 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.654 2009/07/07 02:44:07 drh Exp $
** $Id: btree.c,v 1.655 2009/07/07 11:39:59 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -740,7 +740,8 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
}
offset = PTRMAP_PTROFFSET(iPtrmap, key);
if( offset<0 ){
return SQLITE_CORRUPT_BKPT;
rc = SQLITE_CORRUPT_BKPT;
goto ptrmap_exit;
}
pPtrmap = (u8 *)sqlite3PagerGetData(pDbPage);
@@ -753,6 +754,7 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
}
}
ptrmap_exit:
sqlite3PagerUnref(pDbPage);
return rc;
}