1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Changes to insure that lookaside memory allocations are never used to hold

schema content.
Ticket #3743. (CVS 6377)

FossilOrigin-Name: ea74d8dc62f5784089aa8ef098e97c505a79b176
This commit is contained in:
drh
2009-03-24 15:08:09 +00:00
parent 4be6469146
commit d9da78a2c8
19 changed files with 139 additions and 118 deletions

View File

@@ -12,7 +12,7 @@
**
** Memory allocation functions used throughout sqlite.
**
** $Id: malloc.c,v 1.60 2009/03/23 17:49:15 drh Exp $
** $Id: malloc.c,v 1.61 2009/03/24 15:08:10 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -565,10 +565,10 @@ void *sqlite3DbMallocZero(sqlite3 *db, int n){
*/
void *sqlite3DbMallocRaw(sqlite3 *db, int n){
void *p;
assert( db==0 || sqlite3_mutex_held(db->mutex) );
#ifndef SQLITE_OMIT_LOOKASIDE
if( db ){
LookasideSlot *pBuf;
assert( sqlite3_mutex_held(db->mutex) );
if( db->mallocFailed ){
return 0;
}
@@ -600,6 +600,7 @@ void *sqlite3DbMallocRaw(sqlite3 *db, int n){
*/
void *sqlite3DbRealloc(sqlite3 *db, void *p, int n){
void *pNew = 0;
assert( db!=0 );
assert( sqlite3_mutex_held(db->mutex) );
if( db->mallocFailed==0 ){
if( p==0 ){