diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-12-15 10:02:19 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-12-15 10:02:46 +0100 |
commit | 0b48f8ada2acb0de830b23f8cefc8e3fea28d915 (patch) | |
tree | f7c2811269b6b53199412be2dd5ec02eea15d55d /bson/util/builder.h | |
parent | 85f1cd56145b90a32b7ccdc750000deeed54fe22 (diff) | |
parent | f0d9a01bccdaeb466c12c92057914bbfef59526c (diff) | |
download | mongodb-0b48f8ada2acb0de830b23f8cefc8e3fea28d915.tar.gz |
Merge branch 'upstream/2.0.2'
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; } } |