From 014e2576acf6e615c1ecc1ddd3c3aae5dd579f58 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Sat, 7 Oct 2023 19:53:52 +0900 Subject: [PATCH] in_forward: fix checking return value of cmt_decode_msgpack_create(#8000) 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);