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

Fix some memory leak problems with corrupt.test and auto-vacuum databases. (CVS 2226)

FossilOrigin-Name: 6244252915fa312a6c4d192464023d95aaef4661
This commit is contained in:
danielk1977
2005-01-17 07:53:44 +00:00
parent f10519b45a
commit 5558a8a697
11 changed files with 59 additions and 43 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.240 2005/01/17 02:12:19 danielk1977 Exp $
** $Id: btree.c,v 1.241 2005/01/17 07:53:44 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -495,15 +495,14 @@ static int ptrmapPut(Btree *pBt, Pgno key, u8 eType, Pgno parent){
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));
rc = sqlite3pager_write(pPtrmap);
if( rc!=0 ){
return rc;
if( rc==SQLITE_OK ){
pPtrmap[offset] = eType;
put4byte(&pPtrmap[offset+1], parent);
}
pPtrmap[offset] = eType;
put4byte(&pPtrmap[offset+1], parent);
}
sqlite3pager_unref(pPtrmap);
return SQLITE_OK;
return rc;
}
/*