mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-24 01:26:33 +01:00
added return value checking.
This commit is contained in:
parent
f07950c60a
commit
3ff3ba83f4
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user