File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ class vrefbuffer : public msgpack_vrefbuffer {
2929 vrefbuffer (size_t ref_size = MSGPACK_VREFBUFFER_REF_SIZE,
3030 size_t chunk_size = MSGPACK_VREFBUFFER_CHUNK_SIZE)
3131 {
32- msgpack_vrefbuffer_init (this , ref_size, chunk_size);
32+ if (!msgpack_vrefbuffer_init (this , ref_size, chunk_size)) {
33+ throw std::bad_alloc ();
34+ }
3335 }
3436
3537 ~vrefbuffer ()
Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ class zbuffer : public msgpack_zbuffer {
2929 zbuffer (int level = Z_DEFAULT_COMPRESSION,
3030 size_t init_size = MSGPACK_ZBUFFER_INIT_SIZE)
3131 {
32- msgpack_zbuffer_init (this , level, init_size);
32+ if (!msgpack_zbuffer_init (this , level, init_size)) {
33+ throw std::bad_alloc ();
34+ }
3335 }
3436
3537 ~zbuffer ()
You can’t perform that action at this time.
0 commit comments