From dc46abc890155569ea03d4e5d8adb95d43669f85 Mon Sep 17 00:00:00 2001 From: Bradley Laney Date: Thu, 22 May 2025 11:02:04 -0400 Subject: [PATCH 1/2] input_thread: exit on failures to initialize threaded plugin instances Signed-off-by: Bradley Laney --- src/flb_input_thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flb_input_thread.c b/src/flb_input_thread.c index 2091f9b47fe..64313ce1678 100644 --- a/src/flb_input_thread.c +++ b/src/flb_input_thread.c @@ -620,9 +620,11 @@ int flb_input_thread_instance_init(struct flb_config *config, struct flb_input_i ret = input_thread_instance_get_status(ins); if (ret == -1) { flb_plg_error(ins, "unexpected error loading plugin instance"); + return -1; } else if (ret == FLB_FALSE) { flb_plg_error(ins, "could not initialize threaded plugin instance"); + return -1; } else if (ret == FLB_TRUE) { flb_plg_info(ins, "thread instance initialized"); From 9ec44d5862cd616115bb8b01f3c85899adb6d732 Mon Sep 17 00:00:00 2001 From: Bradley Laney Date: Mon, 19 May 2025 17:45:31 -0400 Subject: [PATCH 2/2] proxy: go: don't free plugin twice `proxy_go_input_init` no longer frees memory that is also cleaned up on flb exit (e.g., a return from `flb_input_thread.c:flb_input_thread_instance_init:610` sees a double free before this change). Signed-off-by: Bradley Laney --- src/proxy/go/go.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/proxy/go/go.c b/src/proxy/go/go.c index 540005a8d9d..b1842f93329 100644 --- a/src/proxy/go/go.c +++ b/src/proxy/go/go.c @@ -224,7 +224,6 @@ int proxy_go_input_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; }