diff options
Diffstat (limited to 'bson/util/builder.h')
-rw-r--r-- | bson/util/builder.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bson/util/builder.h b/bson/util/builder.h index 710c2d4..f189f58 100644 --- a/bson/util/builder.h +++ b/bson/util/builder.h @@ -65,6 +65,8 @@ namespace mongo { if( p == buf ) { if( sz <= SZ ) return buf; void *d = malloc(sz); + if ( d == 0 ) + msgasserted( 15912 , "out of memory StackAllocator::Realloc" ); memcpy(d, p, SZ); return d; } @@ -113,6 +115,8 @@ namespace mongo { if ( maxSize && size > maxSize ) { al.Free(data); data = (char*)al.Malloc(maxSize); + if ( data == 0 ) + msgasserted( 15913 , "out of memory BufBuilder::reset" ); size = maxSize; } } |