about summary refs log tree commit diff
path: root/src/afl-fuzz-cmplog.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2020-03-09 21:34:11 +0100
committerDominik Maier <domenukk@gmail.com>2020-03-09 21:34:11 +0100
commit1136e887bdf77ed64bd3eac28bf7f86705dd2a6d (patch)
tree2c7d0e877c1e6f4fb09e268ca0a194c41bc91f23 /src/afl-fuzz-cmplog.c
parent416020daefb2587fe071a456e1dbb8ffbb007e6a (diff)
downloadafl++-1136e887bdf77ed64bd3eac28bf7f86705dd2a6d.tar.gz
now wiht 90% less leaks
Diffstat (limited to 'src/afl-fuzz-cmplog.c')
-rw-r--r--src/afl-fuzz-cmplog.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/afl-fuzz-cmplog.c b/src/afl-fuzz-cmplog.c
index 3749330b..0a4c3a9e 100644
--- a/src/afl-fuzz-cmplog.c
+++ b/src/afl-fuzz-cmplog.c
@@ -151,7 +151,13 @@ void init_cmplog_forkserver(afl_state_t *afl) {
 
     setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
 
-    if (!afl->qemu_mode) afl->argv[0] = afl->cmplog_binary;
+    if (!afl->qemu_mode && afl->argv[0] != afl->cmplog_binary) {
+
+      ck_free(afl->argv[0]);
+      afl->argv[0] = afl->cmplog_binary;
+
+    }
+
     execv(afl->argv[0], afl->argv);
 
     /* Use a distinctive bitmap signature to tell the parent about execv()
@@ -448,7 +454,13 @@ u8 run_cmplog_target(afl_state_t *afl, u32 timeout) {
 
       setenv("___AFL_EINS_ZWEI_POLIZEI___", "1", 1);
 
-      if (!afl->qemu_mode) afl->argv[0] = afl->cmplog_binary;
+      if (!afl->qemu_mode && afl->argv[0] != afl->cmplog_binary) {
+        
+        ck_free(afl->argv[0]);
+        afl->argv[0] = afl->cmplog_binary;
+
+      }
+
       execv(afl->argv[0], afl->argv);
 
       /* Use a distinctive bitmap value to tell the parent about execv()