mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and
all memory from sqlite3_malloc() is freed by sqlite3_free(). FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
This commit is contained in:
@@ -2004,7 +2004,7 @@ int sqlite3BtreeClose(Btree *p){
|
||||
if( pBt->xFreeSchema && pBt->pSchema ){
|
||||
pBt->xFreeSchema(pBt->pSchema);
|
||||
}
|
||||
sqlite3_free(pBt->pSchema);
|
||||
sqlite3DbFree(0, pBt->pSchema);
|
||||
freeTempSpace(pBt);
|
||||
sqlite3_free(pBt);
|
||||
}
|
||||
@@ -7749,6 +7749,7 @@ char *sqlite3BtreeIntegrityCheck(
|
||||
sCheck.anRef[i] = 1;
|
||||
}
|
||||
sqlite3StrAccumInit(&sCheck.errMsg, zErr, sizeof(zErr), 20000);
|
||||
sCheck.errMsg.useMalloc = 2;
|
||||
|
||||
/* Check the integrity of the freelist
|
||||
*/
|
||||
@@ -7886,7 +7887,7 @@ void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
|
||||
BtShared *pBt = p->pBt;
|
||||
sqlite3BtreeEnter(p);
|
||||
if( !pBt->pSchema && nBytes ){
|
||||
pBt->pSchema = sqlite3MallocZero(nBytes);
|
||||
pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
|
||||
pBt->xFreeSchema = xFree;
|
||||
}
|
||||
sqlite3BtreeLeave(p);
|
||||
|
Reference in New Issue
Block a user