|
| 1 | +diff --git a/plugins/custom_calyptia/calyptia.c b/plugins/custom_calyptia/calyptia.c |
| 2 | +index 5639af427..4aba53ca7 100644 |
| 3 | +--- a/plugins/custom_calyptia/calyptia.c |
| 4 | ++++ b/plugins/custom_calyptia/calyptia.c |
| 5 | +@@ -245,7 +245,6 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config, |
| 6 | + |
| 7 | + if (!cloud) { |
| 8 | + flb_plg_error(ctx->ins, "could not load Calyptia Cloud connector"); |
| 9 | +- flb_free(ctx); |
| 10 | + return NULL; |
| 11 | + } |
| 12 | + |
| 13 | +@@ -254,7 +253,6 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config, |
| 14 | + |
| 15 | + if (ret != 0) { |
| 16 | + flb_plg_error(ctx->ins, "could not load Calyptia Cloud connector"); |
| 17 | +- flb_free(ctx); |
| 18 | + return NULL; |
| 19 | + } |
| 20 | + |
| 21 | +@@ -268,7 +266,6 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config, |
| 22 | + label = flb_sds_create_size(strlen(key->str) + strlen(val->str) + 1); |
| 23 | + |
| 24 | + if (!label) { |
| 25 | +- flb_free(ctx); |
| 26 | + return NULL; |
| 27 | + } |
| 28 | + |
| 29 | +@@ -316,7 +313,6 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config, |
| 30 | + label = flb_sds_create_size(strlen("fleet_id") + strlen(ctx->fleet_id) + 1); |
| 31 | + |
| 32 | + if (!label) { |
| 33 | +- flb_free(ctx); |
| 34 | + return NULL; |
| 35 | + } |
| 36 | + |
| 37 | +@@ -424,6 +420,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, |
| 38 | + |
| 39 | + if (ctx->machine_id == NULL) { |
| 40 | + flb_plg_error(ctx->ins, "unable to retrieve machine_id"); |
| 41 | ++ flb_free(ctx); |
| 42 | + return -1; |
| 43 | + } |
| 44 | + |
| 45 | +@@ -435,6 +432,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, |
| 46 | + |
| 47 | + if (!ctx->i) { |
| 48 | + flb_plg_error(ctx->ins, "could not load metrics collector"); |
| 49 | ++ flb_free(ctx); |
| 50 | + return -1; |
| 51 | + } |
| 52 | + |
| 53 | +@@ -455,6 +453,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins, |
| 54 | + ctx->o = setup_cloud_output(config, ctx); |
| 55 | + |
| 56 | + if (ctx->o == NULL) { |
| 57 | ++ flb_free(ctx); |
| 58 | + return -1; |
| 59 | + } |
| 60 | + } |
0 commit comments