summaryrefslogtreecommitdiff
path: root/bson/util/builder.h
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
committerAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
commitf0d9a01bccdaeb466c12c92057914bbfef59526c (patch)
tree7679efa1f0daf7d1d906882a15dc77af6b7aef32 /bson/util/builder.h
parent5d342a758c6095b4d30aba0750b54f13b8916f51 (diff)
downloadmongodb-f0d9a01bccdaeb466c12c92057914bbfef59526c.tar.gz
Imported Upstream version 2.0.2
Diffstat (limited to 'bson/util/builder.h')
-rw-r--r--bson/util/builder.h4
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;
}
}