1
0
mirror of https://github.com/msgpack/msgpack-c.git synced 2025-03-26 11:46:34 +01:00

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

@ -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()

@ -29,7 +29,9 @@ public:
zbuffer(int level = Z_DEFAULT_COMPRESSION,
size_t init_size = MSGPACK_ZBUFFER_INIT_SIZE)
{
msgpack_zbuffer_init(this, level, init_size);
if (!msgpack_zbuffer_init(this, level, init_size)) {
throw std::bad_alloc();
}
}
~zbuffer()