diff options
author | drh <drh@noemail.net> | 2009-03-24 15:08:09 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-03-24 15:08:09 +0000 |
commit | d9da78a2c89341d2507ff43c1732821c80ca1664 (patch) | |
tree | 56a14f20c1d1acc86755290f55d943013f9d8e42 /src/malloc.c | |
parent | 4be64691468e95abb6ddc33ea89333b4a63e2e08 (diff) | |
download | sqlite-d9da78a2c89341d2507ff43c1732821c80ca1664.tar.gz sqlite-d9da78a2c89341d2507ff43c1732821c80ca1664.zip |
Changes to insure that lookaside memory allocations are never used to hold
schema content.
Ticket #3743. (CVS 6377)
FossilOrigin-Name: ea74d8dc62f5784089aa8ef098e97c505a79b176
Diffstat (limited to 'src/malloc.c')
-rw-r--r-- | src/malloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c index a995e2c0f..92e56394e 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -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 ){ |