one less alloc

This commit is contained in:
Dominik Maier
2020-04-01 01:58:34 +02:00
parent eca55be4fb
commit 74b4096570

View File

@ -168,9 +168,9 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
#ifdef _AFL_DOCUMENT_MUTATIONS #ifdef _AFL_DOCUMENT_MUTATIONS
s32 doc_fd; s32 doc_fd;
char *fn = alloc_printf("%s/mutations/%09u:%s", afl->out_dir, char fn[PATH_MAX];
snprintf(fn, PATH_MAX, ("%s/mutations/%09u:%s", afl->out_dir,
afl->document_counter++, describe_op(afl, 0)); afl->document_counter++, describe_op(afl, 0));
if (fn != NULL) {
if ((doc_fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600)) >= 0) { if ((doc_fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600)) >= 0) {
@ -180,10 +180,6 @@ void write_to_testcase(afl_state_t *afl, void *mem, u32 len) {
} }
ck_free(fn);
}
#endif #endif
if (afl->fsrv.out_file) { if (afl->fsrv.out_file) {