From f84857e38592494ae5df5aa42ea6811a9162985f Mon Sep 17 00:00:00 2001 From: Petter Mabacker Date: Tue, 18 Jun 2024 15:49:38 +0200 Subject: [PATCH] in_syslog: Fix double free when no parser is set When running syslog example: `bin/fluent-bit -i syslog -o stdout -f 1` if no parser is set we get a double-free: ``` [2024/06/18 15:36:32] [ info] [fluent bit] version=3.1.0, commit=2bef95819e, pid=144050 [2024/06/18 15:36:32] [ info] [storage] ver=1.5.2, type=memory, sync=normal, checksum=off, m ax_chunks_up=128 [2024/06/18 15:36:32] [ info] [cmetrics] version=0.9.1 [2024/06/18 15:36:32] [ info] [ctraces ] version=0.5.1 free(): double free detected in tcache 2 [2024/06/18 15:36:32] [ info] [input:syslog:syslog.0] initializing zsh: IOT instruction bin/fluent-bit -i syslog -o stdout -f 1 ``` Remove the redundent flb_log_event_encoder_destroy, since that is already done in syslog_conf_destroy. Signed-off-by: Petter Mabacker --- plugins/in_syslog/syslog_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/in_syslog/syslog_conf.c b/plugins/in_syslog/syslog_conf.c index 2ca03dc9562..a20d78c6a12 100644 --- a/plugins/in_syslog/syslog_conf.c +++ b/plugins/in_syslog/syslog_conf.c @@ -169,8 +169,6 @@ struct flb_syslog *syslog_conf_create(struct flb_input_instance *ins, } if (!ctx->parser) { - flb_log_event_encoder_destroy(ctx->log_encoder); - flb_error("[in_syslog] parser not set"); syslog_conf_destroy(ctx); return NULL;