Skip to content

Commit c26a2d1

Browse files
committed
out_opensearch: release aws signature a retry or error happens
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
1 parent a4c158d commit c26a2d1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

plugins/out_opensearch/opensearch.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk,
974974
ret = flb_http_do(c, &b_sent);
975975
if (ret != 0) {
976976
flb_plg_warn(ctx->ins, "http_do=%i URI=%s", ret, ctx->uri);
977+
if (signature) {
978+
flb_sds_destroy(signature);
979+
signature = NULL;
980+
}
977981
goto retry;
978982
}
979983
else {
@@ -988,6 +992,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk,
988992
flb_plg_error(ctx->ins, "HTTP status=%i URI=%s",
989993
c->resp.status, ctx->uri);
990994
}
995+
if (signature) {
996+
flb_sds_destroy(signature);
997+
signature = NULL;
998+
}
991999
goto retry;
9921000
}
9931001

@@ -1021,6 +1029,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk,
10211029
fflush(stderr);
10221030
}
10231031
}
1032+
if (signature) {
1033+
flb_sds_destroy(signature);
1034+
signature = NULL;
1035+
}
10241036
goto retry;
10251037
}
10261038
else {
@@ -1029,6 +1041,10 @@ static void cb_opensearch_flush(struct flb_event_chunk *event_chunk,
10291041
}
10301042
}
10311043
else {
1044+
if (signature) {
1045+
flb_sds_destroy(signature);
1046+
signature = NULL;
1047+
}
10321048
goto retry;
10331049
}
10341050
}

0 commit comments

Comments
 (0)