Index: third_party/sqlite/src/src/mem5.c |
diff --git a/third_party/sqlite/src/src/mem5.c b/third_party/sqlite/src/src/mem5.c |
index 3fe04e24552cd4d5724e7398d9547fc1fe7a218f..2fdfac141358a359b33a245576f8f70b10533132 100644 |
--- a/third_party/sqlite/src/src/mem5.c |
+++ b/third_party/sqlite/src/src/mem5.c |
@@ -268,7 +268,11 @@ static void *memsys5MallocUnsafe(int nByte){ |
** two in order to create a new free block of size iLogsize. |
*/ |
for(iBin=iLogsize; mem5.aiFreelist[iBin]<0 && iBin<=LOGMAX; iBin++){} |
- if( iBin>LOGMAX ) return 0; |
+ if( iBin>LOGMAX ){ |
+ testcase( sqlite3GlobalConfig.xLog!=0 ); |
+ sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte); |
+ return 0; |
+ } |
i = memsys5UnlinkFirst(iBin); |
while( iBin>iLogsize ){ |
int newSize; |
@@ -391,7 +395,7 @@ static void *memsys5Realloc(void *pPrior, int nBytes){ |
int nOld; |
void *p; |
assert( pPrior!=0 ); |
- assert( (nBytes&(nBytes-1))==0 ); |
+ assert( (nBytes&(nBytes-1))==0 ); /* EV: R-46199-30249 */ |
assert( nBytes>=0 ); |
if( nBytes==0 ){ |
return 0; |