about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-03-09 15:52:14 +0100
committervan Hauser <vh@thc.org>2020-03-09 15:52:14 +0100
commita24352ddfd16c151df48b4a0cf89ced587165f1e (patch)
tree40820b794c590d4cdf46b741fdb5259490324d43
parent2f4166367390e675e59b7231382253ca2d5ec247 (diff)
downloadafl++-a24352ddfd16c151df48b4a0cf89ced587165f1e.tar.gz
fix leaks
-rwxr-xr-xafl-cmin1
-rw-r--r--include/afl-fuzz.h1
-rw-r--r--include/list.h1
-rw-r--r--src/afl-fuzz-globals.c1
-rw-r--r--src/afl-showmap.c1
-rw-r--r--src/afl-tmin.c5
6 files changed, 10 insertions, 0 deletions
diff --git a/afl-cmin b/afl-cmin
index ea57015e..8ae8f0b6 100755
--- a/afl-cmin
+++ b/afl-cmin
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 export AFL_QUIET=1
+export ASAN_OPTIONS=detect_leaks=0
 THISPATH=`dirname ${0}`
 export PATH="${THISPATH}:$PATH"
 awk -f - -- ${@+"$@"} <<'EOF'
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index fbec77f8..d49898dd 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -887,3 +887,4 @@ static u64 next_p2(u64 val) {
 }
 
 #endif
+
diff --git a/include/list.h b/include/list.h
index 2f6a70b0..1190931f 100644
--- a/include/list.h
+++ b/include/list.h
@@ -178,3 +178,4 @@ static bool list_contains(list_t *list, void *contains_me) {
 }
 
 #endif
+
diff --git a/src/afl-fuzz-globals.c b/src/afl-fuzz-globals.c
index 83f9d912..f74917ea 100644
--- a/src/afl-fuzz-globals.c
+++ b/src/afl-fuzz-globals.c
@@ -126,3 +126,4 @@ void afl_state_deinit(afl_state_t *afl) {
   list_remove(&afl_states, afl);
 
 }
+
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index fe520af4..90161bb3 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -1032,6 +1032,7 @@ int main(int argc, char** argv, char** envp) {
   u8 child_timed_out = fsrv->child_timed_out;
   afl_fsrv_deinit(fsrv);
   free(fsrv);
+  if (stdin_file) ck_free(stdin_file);
 
   exit(child_crashed * 2 + child_timed_out);
 
diff --git a/src/afl-tmin.c b/src/afl-tmin.c
index d07bdd6c..84e69184 100644
--- a/src/afl-tmin.c
+++ b/src/afl-tmin.c
@@ -803,6 +803,8 @@ next_del_blksize:
 
 finalize_all:
 
+  if (tmp_buf) ck_free(tmp_buf);
+
   if (hang_mode) {
 
     SAYF("\n" cGRA "     File size reduced by : " cRST
@@ -1350,7 +1352,10 @@ int main(int argc, char** argv, char** envp) {
 
   afl_shm_deinit(&shm);
   afl_fsrv_deinit(fsrv);
+  if (fsrv->out_file) ck_free(fsrv->out_file);
   free(fsrv);
+  if (mask_bitmap) ck_free(mask_bitmap);
+  if (in_data) ck_free(in_data);
 
   exit(0);