Skip to content

Commit

Permalink
custom_calyptia: release ctx if init failed
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Mar 14, 2024
1 parent 31abfbb commit da8aea7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/custom_calyptia/calyptia.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit da8aea7

Please sign in to comment.