less allocs

This commit is contained in:
Dominik Maier 2020-03-27 23:23:11 +01:00
parent b7f3d180aa
commit 762421b355

View File

@ -33,16 +33,16 @@ void write_stats_file(afl_state_t *afl, double bitmap_cvg, double stability,
struct rusage rus;
unsigned long long int cur_time = get_cur_time();
u8 * fn = alloc_printf("%s/fuzzer_stats", afl->out_dir);
u8 fn[PATH_MAX];
s32 fd;
FILE * f;
snprintf(fn, PATH_MAX, "%s/fuzzer_stats", afl->out_dir);
fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fd < 0) PFATAL("Unable to create '%s'", fn);
ck_free(fn);
f = fdopen(fd, "w");
if (!f) PFATAL("fdopen() failed");