diff options
author | danielk1977 <danielk1977@noemail.net> | 2006-01-11 16:10:20 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2006-01-11 16:10:20 +0000 |
commit | 0203bde908cb15eecef3a03c9761827e165d71db (patch) | |
tree | bf746108b46fbf2d2a05edd7998417a99bf3723a /src/util.c | |
parent | b82e7edae9c6f8b0c9f2f6745442b5663a55b51a (diff) | |
download | sqlite-0203bde908cb15eecef3a03c9761827e165d71db.tar.gz sqlite-0203bde908cb15eecef3a03c9761827e165d71db.zip |
Ensure the database attached as part of VACUUM can be detached successfully after a malloc() failure. (CVS 2918)
FossilOrigin-Name: 8c26893c65574b0667bb84bde3ca49751079cc8d
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c index 1a8287b07..4064dadc9 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.166 2006/01/10 15:18:28 drh Exp $ +** $Id: util.c,v 1.167 2006/01/11 16:10:20 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -438,6 +438,7 @@ static void * OSMALLOC(int n){ ThreadData *pTsd = sqlite3ThreadData(); pTsd->nMaxAlloc = MAX(pTsd->nMaxAlloc, pTsd->nAlloc); #endif + assert( sqlite3ThreadData()->mallocAllowed ); if( !failMalloc() ){ u32 *p; p = (u32 *)sqlite3OsMalloc(n + TESTALLOC_OVERHEAD); @@ -479,6 +480,7 @@ static void * OSREALLOC(void *pRealloc, int n){ ThreadData *pTsd = sqlite3ThreadData(); pTsd->nMaxAlloc = MAX(pTsd->nMaxAlloc, pTsd->nAlloc); #endif + assert( sqlite3ThreadData()->mallocAllowed ); if( !failMalloc() ){ u32 *p = (u32 *)getOsPointer(pRealloc); checkGuards(p); |