From dd1af6618db23174337f7a12ba112d86a73c2c09 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Tue, 17 Oct 2023 23:22:17 +0900 Subject: [PATCH] in_forward: fix checking return value of cmt_decode_msgpack_create(#8000) (#8015) Signed-off-by: Takahiro Yamashita --- plugins/in_forward/fw_prot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/in_forward/fw_prot.c b/plugins/in_forward/fw_prot.c index 2a23b625441..b656a100321 100644 --- a/plugins/in_forward/fw_prot.c +++ b/plugins/in_forward/fw_prot.c @@ -778,7 +778,8 @@ int fw_prot_process(struct flb_input_instance *ins, struct fw_conn *conn) } else if (event_type == FLB_EVENT_TYPE_METRICS) { ret = cmt_decode_msgpack_create(&cmt, (char *) data, len, &off); - if (ret == -1) { + if (ret != CMT_DECODE_MSGPACK_SUCCESS) { + flb_error("cmt_decode_msgpack_create failed. ret=%d", ret); msgpack_unpacked_destroy(&result); msgpack_unpacker_free(unp); flb_sds_destroy(out_tag);