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;