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; }