1
0
mirror of https://github.com/msgpack/msgpack-c.git synced 2025-03-25 01:55:39 +01:00

Merge pull request from redboltz/add_throw

added return value checking.
This commit is contained in:
Takatoshi Kondo 2013-08-23 00:34:21 -07:00
commit ce9e543882
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()