[PATCH] D58622: [libFuzzer] fix missing close on opened file

Paul Chaignon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 08:38:32 PST 2019


pchaigno updated this revision to Diff 188190.
pchaigno marked an inline comment as not done.
pchaigno added a comment.

Close the file as soon as possible.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58622/new/

https://reviews.llvm.org/D58622

Files:
  lib/fuzzer/standalone/StandaloneFuzzTargetMain.c


Index: lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
===================================================================
--- lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
+++ lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
@@ -32,6 +32,7 @@
     fseek(f, 0, SEEK_SET);
     unsigned char *buf = (unsigned char*)malloc(len);
     size_t n_read = fread(buf, 1, len, f);
+    fclose(f);
     assert(n_read == len);
     LLVMFuzzerTestOneInput(buf, len);
     free(buf);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58622.188190.patch
Type: text/x-patch
Size: 474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190225/fdd28558/attachment.bin>


More information about the llvm-commits mailing list