From d6dc1e9eb814416c12fb64074234fcac3648c991 Mon Sep 17 00:00:00 2001 From: Phillip Whelan Date: Mon, 10 Oct 2022 14:48:11 -0300 Subject: [PATCH] config: fix property values being truncated. Signed-off-by: Phillip Whelan --- src/config_format/flb_config_format.c | 2 +- src/fluent-bit.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config_format/flb_config_format.c b/src/config_format/flb_config_format.c index e1e8db7b124..8895c9ffe14 100644 --- a/src/config_format/flb_config_format.c +++ b/src/config_format/flb_config_format.c @@ -193,7 +193,7 @@ struct cfl_variant *flb_cf_section_property_add(struct flb_cf *cf, } if (v_len == 0) { - v_len = strlen(k_buf); + v_len = strlen(v_buf); } val = flb_sds_create_len(v_buf, v_len); if (val == NULL) { diff --git a/src/fluent-bit.c b/src/fluent-bit.c index 05a90cf72eb..2f9f52660ba 100644 --- a/src/fluent-bit.c +++ b/src/fluent-bit.c @@ -723,14 +723,15 @@ static int service_configure_plugin(struct flb_config *config, ins = flb_output_new(config, tmp, NULL, FLB_TRUE); } flb_sds_destroy(tmp); - flb_sds_destroy(name); /* validate the instance creation */ if (!ins) { flb_error("[config] section '%s' tried to instance a plugin name " "that don't exists", name); + flb_sds_destroy(name); return -1; } + flb_sds_destroy(name); /* * iterate section properties and populate instance by using specific