From 5404c33a6c621e809d74eaba215f83410eec5e29 Mon Sep 17 00:00:00 2001 From: Konstantin M <10166012+ezdev128@users.noreply.github.com> Date: Mon, 11 Dec 2023 10:01:56 +0300 Subject: [PATCH] Fixed issue https://github.com/fluent/fluent-bit/issues/8253 --- src/proxy/go/go.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/proxy/go/go.c b/src/proxy/go/go.c index 9d95a88afcc..a63f2f942b4 100644 --- a/src/proxy/go/go.c +++ b/src/proxy/go/go.c @@ -135,11 +135,12 @@ int proxy_go_output_flush(struct flb_plugin_proxy_context *ctx, memcpy(buf, tag, tag_len); buf[tag_len] = '\0'; - if (plugin->cb_flush_ctx) { - ret = plugin->cb_flush_ctx(ctx->remote_context, data, size, buf); - } - else { - ret = plugin->cb_flush(data, size, buf); + if (ctx->remote_context != NULL) { + if (plugin->cb_flush_ctx) { + ret = plugin->cb_flush_ctx(ctx->remote_context, data, size, buf); + } else { + ret = plugin->cb_flush(data, size, buf); + } } flb_free(buf); return ret;