Skip to content

Commit

Permalink
go: plugin_proxy: Handle FLBPluginInit(cb_init) error correctly and p…
Browse files Browse the repository at this point in the history
…lug a SEGV case

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Dec 19, 2023
1 parent ac071a8 commit 79e61bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/flb_plugin_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,12 @@ int flb_proxy_output_cb_init(struct flb_output_instance *o_ins,
pc->proxy->def->proxy);
}

if (ret == -1) {
flb_error("[output] could not initialize '%s' plugin",
o_ins->p->name);
return -1;
}

/* Multi-threading enabled if configured */
ret = flb_output_enable_multi_threading(o_ins, config);
if (ret == -1) {
Expand Down
1 change: 0 additions & 1 deletion src/proxy/go/go.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ int proxy_go_output_init(struct flb_plugin_proxy *proxy)
if (ret <= 0) {
flb_error("[go proxy]: plugin '%s' failed to initialize",
plugin->name);
flb_free(plugin);
return -1;
}

Expand Down

0 comments on commit 79e61bd

Please sign in to comment.