Skip to content

Commit 9b6135b

Browse files
committedFeb 26, 2019
[libFuzzer] fix missing close on opened file
Summary: When running the standalone main on a large corpus, I eventually get a EMFILE error ("Too many open files"). Patch by Paul Chaignon Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: lebedev.ri, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58622 llvm-svn: 354918
1 parent 01706bd commit 9b6135b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎compiler-rt/lib/fuzzer/standalone/StandaloneFuzzTargetMain.c

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int main(int argc, char **argv) {
3232
fseek(f, 0, SEEK_SET);
3333
unsigned char *buf = (unsigned char*)malloc(len);
3434
size_t n_read = fread(buf, 1, len, f);
35+
fclose(f);
3536
assert(n_read == len);
3637
LLVMFuzzerTestOneInput(buf, len);
3738
free(buf);

0 commit comments

Comments
 (0)
Please sign in to comment.