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:
10
src/util.c
10
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.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
|
||||
|
||||
Reference in New Issue
Block a user