From df465216583afcc0e65e4468e6383afd7a688ddc Mon Sep 17 00:00:00 2001 From: h1994st Date: Tue, 3 Mar 2020 19:48:13 -0500 Subject: Finish refactoring APIs for the custom mutator and Python module - Remove AFL_PYTHON_ONLY (env) and python_only (variable) - Unify fuzz API of the custom mutator and Python module - Merge the custom mutator into the old python_stage, which is now renamed to custom_mutator_stage --- src/afl-fuzz-run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/afl-fuzz-run.c') diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c index a1d10387..12352355 100644 --- a/src/afl-fuzz-run.c +++ b/src/afl-fuzz-run.c @@ -309,11 +309,12 @@ void write_to_testcase(void* mem, u32 len) { lseek(fd, 0, SEEK_SET); - if (mutator->afl_custom_pre_save) { + if (mutator && mutator->afl_custom_pre_save) { u8* new_data; size_t new_size = mutator->afl_custom_pre_save(mem, len, &new_data); ck_write(fd, new_data, new_size, out_file); + ck_free(new_data); } else { -- cgit 1.4.1