Skip to content

Commit

Permalink
pack_gelf: ensure proper cleanup in case of failure.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
DavidKorczynski authored and edsiper committed Jul 20, 2021
1 parent ad9b139 commit 70ddace
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/flb_pack_gelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 70ddace

Please sign in to comment.