From 11f53c22ae7c9f42606d70ffdfac6ce50b6c35cb Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Sat, 8 Nov 2025 08:25:54 -0600 Subject: [PATCH] out_opensearch: release aws signature a retry or error happens Signed-off-by: Eduardo Silva --- plugins/out_opensearch/opensearch.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/out_opensearch/opensearch.c b/plugins/out_opensearch/opensearch.c index 3f52a7abd1f..1037987becc 100644 --- a/plugins/out_opensearch/opensearch.c +++ b/plugins/out_opensearch/opensearch.c @@ -974,6 +974,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk, ret = flb_http_do(c, &b_sent); if (ret != 0) { flb_plg_warn(ctx->ins, "http_do=%i URI=%s", ret, ctx->uri); + if (signature) { + flb_sds_destroy(signature); + signature = NULL; + } goto retry; } else { @@ -988,6 +992,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk, flb_plg_error(ctx->ins, "HTTP status=%i URI=%s", c->resp.status, ctx->uri); } + if (signature) { + flb_sds_destroy(signature); + signature = NULL; + } goto retry; } @@ -1021,6 +1029,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk, fflush(stderr); } } + if (signature) { + flb_sds_destroy(signature); + signature = NULL; + } goto retry; } else { @@ -1029,6 +1041,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk, } } else { + if (signature) { + flb_sds_destroy(signature); + signature = NULL; + } goto retry; } }