about summary refs log tree commit diff
path: root/src/afl-fuzz-run.c
diff options
context:
space:
mode:
authorh1994st <h1994st@gmail.com>2020-03-03 19:48:13 -0500
committerh1994st <h1994st@gmail.com>2020-03-03 19:48:13 -0500
commitdf465216583afcc0e65e4468e6383afd7a688ddc (patch)
tree84ee509f58fc76aee6f4ba9d0aa9e44f256f50e8 /src/afl-fuzz-run.c
parent90506479e7de57c97d97958c61b2513009687d90 (diff)
downloadafl++-df465216583afcc0e65e4468e6383afd7a688ddc.tar.gz
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
Diffstat (limited to 'src/afl-fuzz-run.c')
-rw-r--r--src/afl-fuzz-run.c3
1 files changed, 2 insertions, 1 deletions
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 {