1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Check for multiple calls to sqlite3FailedMalloc(). Ignore the second and subsequent calls. (CVS 3691)

FossilOrigin-Name: 7180874592ffcaf8e2fe3c3b6b37449654da709b
This commit is contained in:
danielk1977
2007-03-15 15:33:31 +00:00
parent a7aea3dd52
commit 8d848d1da3
3 changed files with 14 additions and 12 deletions

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.193 2006/09/15 07:28:51 drh Exp $
** $Id: util.c,v 1.194 2007/03/15 15:33:32 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -1461,9 +1461,11 @@ int sqlite3MallocFailed(){
** Set the "malloc has failed" condition to true for this thread.
*/
void sqlite3FailedMalloc(){
sqlite3OsEnterMutex();
assert( mallocHasFailed==0 );
mallocHasFailed = 1;
if( !sqlite3MallocFailed() ){
sqlite3OsEnterMutex();
assert( mallocHasFailed==0 );
mallocHasFailed = 1;
}
}
#ifdef SQLITE_MEMDEBUG