Skip to content

Commit

Permalink
in_syslog: Fix double free when no parser is set
Browse files Browse the repository at this point in the history
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 <petter.mabacker@esab.se>
  • Loading branch information
Petter Mabacker committed Jun 18, 2024
1 parent 2bef958 commit f84857e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions plugins/in_syslog/syslog_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f84857e

Please sign in to comment.