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

Fix a double-free that can occur after database corruption is detected. (CVS 6921)

FossilOrigin-Name: 5260e8b1048af2e00d49706466d9aded90c24ed2
This commit is contained in:
danielk1977
2009-07-22 14:08:13 +00:00
parent fe6212d549
commit 146ba99061
3 changed files with 11 additions and 11 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.698 2009/07/22 00:35:24 drh Exp $
** $Id: btree.c,v 1.699 2009/07/22 14:08:14 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -6830,7 +6830,7 @@ static int clearDatabasePage(
int freePageFlag, /* Deallocate page if true */
int *pnChange
){
MemPage *pPage = 0;
MemPage *pPage;
int rc;
unsigned char *pCell;
int i;
@@ -6841,7 +6841,7 @@ static int clearDatabasePage(
}
rc = getAndInitPage(pBt, pgno, &pPage);
if( rc ) goto cleardatabasepage_out;
if( rc ) return rc;
for(i=0; i<pPage->nCell; i++){
pCell = findCell(pPage, i);
if( !pPage->leaf ){