about summary refs log tree commit diff
path: root/src/afl-fuzz-cmplog.c
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-04-10 16:45:45 +0200
committerhexcoder- <heiko@hexco.de>2020-04-10 16:45:45 +0200
commit6aa6af04acb8f024696e8723e6d73514006b3dd5 (patch)
tree03a2fb69279d184d3ae7a93bca41f72a27217865 /src/afl-fuzz-cmplog.c
parent5b977453cbff9778335eabaa5c2f808291a495ed (diff)
downloadafl++-6aa6af04acb8f024696e8723e6d73514006b3dd5.tar.gz
files opened with fdopen should be closed with fclose
Diffstat (limited to 'src/afl-fuzz-cmplog.c')
-rw-r--r--src/afl-fuzz-cmplog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afl-fuzz-cmplog.c b/src/afl-fuzz-cmplog.c
index f932f33b..98f7db05 100644
--- a/src/afl-fuzz-cmplog.c
+++ b/src/afl-fuzz-cmplog.c
@@ -121,7 +121,7 @@ void init_cmplog_forkserver(afl_state_t *afl) {
 #ifndef HAVE_ARC4RANDOM
     close(afl->fsrv.dev_urandom_fd);
 #endif
-    close(afl->fsrv.plot_file == NULL ? -1 : fileno(afl->fsrv.plot_file));
+    if (afl->fsrv.plot_file != NULL) fclose(afl->fsrv.plot_file);
 
     /* This should improve performance a bit, since it stops the linker from
        doing extra work post-fork(). */