aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c5
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 ){