From 9ebb768c74300d5e50dd3af317bdb87566b63997 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Sun, 2 Jul 2023 07:42:22 +0900 Subject: [PATCH] out_syslog: check error after flb_log_event_decoder_next Signed-off-by: Takahiro Yamashita --- plugins/out_syslog/syslog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/out_syslog/syslog.c b/plugins/out_syslog/syslog.c index 83484ff98ad..a333513543f 100644 --- a/plugins/out_syslog/syslog.c +++ b/plugins/out_syslog/syslog.c @@ -991,9 +991,9 @@ static int cb_syslog_format_test(struct flb_config *config, return -1; } - if ((ret = flb_log_event_decoder_next( - &log_decoder, - &log_event)) != FLB_EVENT_DECODER_SUCCESS) { + flb_log_event_decoder_next(&log_decoder, &log_event); + ret = flb_log_event_decoder_get_last_result(&log_decoder); + if (ret != FLB_EVENT_DECODER_SUCCESS) { flb_error("msgpack_unpack_next failed"); flb_log_event_decoder_destroy(&log_decoder);