From 70ddace8820aa537963f8c2d1d0f2cd53e6fd9ba Mon Sep 17 00:00:00 2001 From: David Korczynski Date: Tue, 20 Jul 2021 17:29:27 +0100 Subject: [PATCH] pack_gelf: ensure proper cleanup in case of failure. Memory leaks can happen if msgpack_unpack_next fails. Bug tracker: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35460 Signed-off-by: David Korczynski --- src/flb_pack_gelf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flb_pack_gelf.c b/src/flb_pack_gelf.c index 883e489b7c4..241f2c24320 100644 --- a/src/flb_pack_gelf.c +++ b/src/flb_pack_gelf.c @@ -801,6 +801,7 @@ flb_sds_t flb_msgpack_raw_to_gelf(char *buf, size_t buf_size, msgpack_unpacked_init(&result); ret = msgpack_unpack_next(&result, buf, buf_size, &off); if (ret != MSGPACK_UNPACK_SUCCESS) { + msgpack_unpacked_destroy(&result); return NULL; }