files opened with fdopen should be closed with fclose

This commit is contained in:
hexcoder-
2020-04-10 16:45:45 +02:00
parent 5b977453cb
commit 6aa6af04ac
2 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv) {
#ifndef HAVE_ARC4RANDOM
close(fsrv->dev_urandom_fd);
#endif
close(fsrv->plot_file == NULL ? -1 : fileno(fsrv->plot_file));
if (fsrv->plot_file != NULL) fclose(fsrv->plot_file);
/* This should improve performance a bit, since it stops the linker from
doing extra work post-fork(). */

View File

@ -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(). */