From c3465e6fc334af35e2818b71a5f87da954d18cf4 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Fri, 3 Nov 2023 16:50:58 +0900 Subject: [PATCH] in_fluentbit_metrics: add missing release function on init Signed-off-by: Takahiro Yamashita --- plugins/in_fluentbit_metrics/metrics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/in_fluentbit_metrics/metrics.c b/plugins/in_fluentbit_metrics/metrics.c index 779a0365105..c11d02dcb88 100644 --- a/plugins/in_fluentbit_metrics/metrics.c +++ b/plugins/in_fluentbit_metrics/metrics.c @@ -118,6 +118,7 @@ static int in_metrics_init(struct flb_input_instance *in, flb_plg_error(ctx->ins, "could not set collector on start for Fluent Bit " "metrics plugin"); + flb_free(ctx); return -1; } ctx->coll_fd_start = ret; @@ -131,6 +132,7 @@ static int in_metrics_init(struct flb_input_instance *in, if (ret == -1) { flb_plg_error(ctx->ins, "could not set collector for Fluent Bit metrics plugin"); + flb_free(ctx); return -1; } ctx->coll_fd_runtime = ret;