Skip to content

Commit da8aea7

Browse files
nokute78edsiper
authored andcommitted
custom_calyptia: release ctx if init failed
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 31abfbb commit da8aea7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/custom_calyptia/calyptia.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins,
420420

421421
if (ctx->machine_id == NULL) {
422422
flb_plg_error(ctx->ins, "unable to retrieve machine_id");
423+
flb_free(ctx);
423424
return -1;
424425
}
425426

@@ -431,6 +432,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins,
431432

432433
if (!ctx->i) {
433434
flb_plg_error(ctx->ins, "could not load metrics collector");
435+
flb_free(ctx);
434436
return -1;
435437
}
436438

0 commit comments

Comments
 (0)