Skip to content

Commit 9024ddd

Browse files
author
usharma
committed
out_s3: Free s3 headers in case of encoding header not present
We need to free the s3 headers from memory in case compression not present Signed-off-by: usharma <[email protected]>
1 parent 1ced9cf commit 9024ddd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/out_s3/s3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ int create_headers(struct flb_s3 *ctx, char *body_md5,
216216
if (ctx->compression == FLB_AWS_COMPRESS_GZIP || ctx->compression == FLB_AWS_COMPRESS_ZSTD) {
217217
encoding_header = get_content_encoding_header(ctx->compression);
218218

219-
if(encoding_header == NULL){
219+
if (encoding_header == NULL) {
220220
flb_errno();
221+
flb_free(s3_headers);
221222
return -1;
222223
}
223224
s3_headers[n] = *encoding_header;

0 commit comments

Comments
 (0)