mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-22 08:02:08 +02:00
Fix memory leaks
This commit is contained in:
@@ -44,6 +44,7 @@ bool msgpack_vrefbuffer_init(msgpack_vrefbuffer* vbuf,
|
||||
vbuf->array = array;
|
||||
|
||||
if((sizeof(msgpack_vrefbuffer_chunk) + chunk_size) < chunk_size){
|
||||
free(array);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -171,7 +172,7 @@ int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
|
||||
int msgpack_vrefbuffer_migrate(msgpack_vrefbuffer* vbuf, msgpack_vrefbuffer* to)
|
||||
{
|
||||
size_t sz = vbuf->chunk_size;
|
||||
msgpack_vrefbuffer_chunk* empty = NULL;
|
||||
msgpack_vrefbuffer_chunk* empty;
|
||||
|
||||
if((sizeof(msgpack_vrefbuffer_chunk) + sz) < sz){
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user