From ecc7e81f91619271e67e43be1c086f8fdb6600d3 Mon Sep 17 00:00:00 2001 From: David Korczynski Date: Tue, 8 Aug 2023 10:51:20 -0700 Subject: [PATCH 1/2] out_s3: fix potential file descriptor leak Signed-off-by: David Korczynski --- plugins/out_s3/s3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/out_s3/s3.c b/plugins/out_s3/s3.c index f938cdaf51e..1718cc735d4 100644 --- a/plugins/out_s3/s3.c +++ b/plugins/out_s3/s3.c @@ -294,6 +294,7 @@ static int read_seq_index(char *seq_index_file, uint64_t *seq_index) ret = fscanf(fp, "%"PRIu64, seq_index); if (ret != 1) { + fclose(fp); flb_errno(); return -1; } From 73ec7d458788b7690279d3505c6579fe112e5c49 Mon Sep 17 00:00:00 2001 From: David Korczynski Date: Tue, 8 Aug 2023 10:59:32 -0700 Subject: [PATCH 2/2] out_s3: fix file descriptor leak Signed-off-by: David Korczynski --- plugins/out_s3/s3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/out_s3/s3.c b/plugins/out_s3/s3.c index 1718cc735d4..57e68e6ef90 100644 --- a/plugins/out_s3/s3.c +++ b/plugins/out_s3/s3.c @@ -317,6 +317,7 @@ static int write_seq_index(char *seq_index_file, uint64_t seq_index) ret = fprintf(fp, "%"PRIu64, seq_index); if (ret < 0) { + fclose(fp); flb_errno(); return -1; }