Added std::nothrow

This commit is contained in:
Benoit Blanchon
2014-12-20 15:15:41 +01:00
parent c32e306be9
commit c726506b47

View File

@ -53,7 +53,10 @@ class DynamicJsonBuffer : public JsonBuffer {
}
void* allocInOtherBlocks(size_t bytes) {
if (!_next) _next = new DynamicJsonBuffer();
if (!_next) {
_next = new (std::nothrow) DynamicJsonBuffer();
if (!_next) return NULL;
}
return _next->alloc(bytes);
}