Skip to content

Commit

Permalink
output: release instance when init failed (fluent#3576)
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and Brian McQueen committed Jun 29, 2021
1 parent 8cdba69 commit 489a83e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/flb_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ int flb_output_init_all(struct flb_config *config)
if (p->type == FLB_OUTPUT_PLUGIN_PROXY) {
ret = flb_plugin_proxy_init(p->proxy, ins, config);
if (ret == -1) {
flb_output_instance_destroy(ins);
return -1;
}
continue;
Expand Down Expand Up @@ -878,6 +879,7 @@ int flb_output_init_all(struct flb_config *config)
if (!config_map) {
flb_error("[output] error loading config map for '%s' plugin",
p->name);
flb_output_instance_destroy(ins);
return -1;
}
ins->config_map = config_map;
Expand Down Expand Up @@ -940,6 +942,7 @@ int flb_output_init_all(struct flb_config *config)
if (ret == -1) {
flb_error("[output] Failed to initialize '%s' plugin",
p->name);
flb_output_instance_destroy(ins);
return -1;
}

Expand All @@ -949,6 +952,7 @@ int flb_output_init_all(struct flb_config *config)
if (ret == -1) {
flb_error("[output] could not start thread pool for '%s' plugin",
p->name);
flb_output_instance_destroy(ins);
return -1;
}

Expand Down

0 comments on commit 489a83e

Please sign in to comment.