From da8aea7574f773bf8ba23900c7e8c3fa8d86953c Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Sat, 2 Mar 2024 08:05:56 +0900 Subject: [PATCH] custom_calyptia: release ctx if init failed Signed-off-by: Takahiro Yamashita --- plugins/custom_calyptia/calyptia.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/custom_calyptia/calyptia.c b/plugins/custom_calyptia/calyptia.c index 351a16b0d75..4aba53ca79c 100644 --- a/plugins/custom_calyptia/calyptia.c +++ b/plugins/custom_calyptia/calyptia.c @@ -420,6 +420,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, if (ctx->machine_id == NULL) { flb_plg_error(ctx->ins, "unable to retrieve machine_id"); + flb_free(ctx); return -1; } @@ -431,6 +432,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, if (!ctx->i) { flb_plg_error(ctx->ins, "could not load metrics collector"); + flb_free(ctx); return -1; }