mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Ensure the database attached as part of VACUUM can be detached successfully after a malloc() failure. (CVS 2918)
FossilOrigin-Name: 8c26893c65574b0667bb84bde3ca49751079cc8d
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user