[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 07:49:51 PST 2019


pchaigno marked an inline comment as done.
pchaigno added inline comments.


================
Comment at: lib/fuzzer/standalone/StandaloneFuzzTargetMain.c:34
     unsigned char *buf = (unsigned char*)malloc(len);
     size_t n_read = fread(buf, 1, len, f);
     assert(n_read == len);
----------------
lebedev.ri wrote:
> You probably can even close it right after `fread`?
Yes. I wasn't sure what was best: closing as soon as possible or grouping the "cleaning actions".


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58622





More information about the llvm-commits mailing list