aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2019-07-08 13:45:02 +0000
committerdan <dan@noemail.net>2019-07-08 13:45:02 +0000
commitbedf84c17bb5b5a811cd395892c1f89f5f458b70 (patch)
tree85535684601a099be2703a6bf85335e0b03b11d1 /src
parent62742fd2647ccd6a5cd2f899db70b6062f671c33 (diff)
downloadsqlite-bedf84c17bb5b5a811cd395892c1f89f5f458b70.tar.gz
sqlite-bedf84c17bb5b5a811cd395892c1f89f5f458b70.zip
Fix an assert() that [28196d89] caused to fail.
FossilOrigin-Name: 8fb0c6d5a38e77aa4c5f394fb8af1b0c7c6a4790e932aabc213a3078ee9acaf6
Diffstat (limited to 'src')
-rw-r--r--src/build.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c
index 380af8379..53314593b 100644
--- a/src/build.c
+++ b/src/build.c
@@ -618,10 +618,14 @@ static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
#ifdef SQLITE_DEBUG
/* Record the number of outstanding lookaside allocations in schema Tables
- ** prior to doing any free() operations. Since schema Tables do not use
- ** lookaside, this number should not change. */
+ ** prior to doing any free() operations. Since schema Tables do not use
+ ** lookaside, this number should not change.
+ **
+ ** If malloc has already failed, it may be that it failed while allocating
+ ** a Table object that was going to be marked ephemeral. So do not check
+ ** that no lookaside memory is used in this case either. */
int nLookaside = 0;
- if( db && (pTable->tabFlags & TF_Ephemeral)==0 ){
+ if( db && !db->mallocFailed && (pTable->tabFlags & TF_Ephemeral)==0 ){
nLookaside = sqlite3LookasideUsed(db, 0);
}
#endif