added return value checking.

This commit is contained in:
Takatoshi Kondo
2013-08-19 15:26:12 +09:00
parent f07950c60a
commit 3ff3ba83f4
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ public:
vrefbuffer(size_t ref_size = MSGPACK_VREFBUFFER_REF_SIZE,
size_t chunk_size = MSGPACK_VREFBUFFER_CHUNK_SIZE)
{
msgpack_vrefbuffer_init(this, ref_size, chunk_size);
if (!msgpack_vrefbuffer_init(this, ref_size, chunk_size)) {
throw std::bad_alloc();
}
}
~vrefbuffer()