diff --git a/src/unpack.c b/src/unpack.c index 7af4e65d..20a02e4b 100644 --- a/src/unpack.c +++ b/src/unpack.c @@ -492,9 +492,7 @@ void msgpack_unpacker_reset(msgpack_unpacker* mpac) msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* result) { - if(result->zone != NULL) { - msgpack_zone_free(result->zone); - } + msgpack_unpacked_destroy(result); int ret = msgpack_unpacker_execute(mpac); diff --git a/test/streaming_c.cpp b/test/streaming_c.cpp index 159eef76..34fbfa98 100644 --- a/test/streaming_c.cpp +++ b/test/streaming_c.cpp @@ -110,5 +110,5 @@ TEST(streaming, basic) msgpack_unpacker_destroy(&pac); msgpack_unpacked_destroy(&result); + msgpack_sbuffer_free(buffer); } -