about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-17 07:52:21 +0200
committervan Hauser <vh@thc.org>2020-04-17 07:52:21 +0200
commit16ce55584512274804eadd71b4790be3d1bfbf97 (patch)
treeed95fbfa7c7c3d064e7fdcc5e87bbccd895db4c1
parentc961925356bf3388066969b9975b424c4cdae890 (diff)
downloadafl++-16ce55584512274804eadd71b4790be3d1bfbf97.tar.gz
fixed 2 unimportant leaks
-rwxr-xr-xqemu_mode/build_qemu_support.sh1
-rw-r--r--src/afl-common.c6
-rw-r--r--src/afl-showmap.c1
3 files changed, 7 insertions, 1 deletions
diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh
index 118f6ebd..3b5378a4 100755
--- a/qemu_mode/build_qemu_support.sh
+++ b/qemu_mode/build_qemu_support.sh
@@ -233,6 +233,7 @@ if [ "$ORIG_CPU_TARGET" = "" ]; then
   gcc test-instr.c -o test-instr || exit 1
 
   unset AFL_INST_RATIO
+  export ASAN_OPTIONS=detect_leaks=0
 
   echo 0 | ./afl-showmap -m none -Q -q -o .test-instr0 ./test-instr || exit 1
   echo 1 | ./afl-showmap -m none -Q -q -o .test-instr1 ./test-instr || exit 1
diff --git a/src/afl-common.c b/src/afl-common.c
index ffc32533..c9f09d38 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -374,9 +374,13 @@ u8 *find_binary(u8 *fname) {
     target_path = ck_strdup(fname);
 
     if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
-        !(st.st_mode & 0111) || st.st_size < 4)
+        !(st.st_mode & 0111) || st.st_size < 4) {
+
+      free(target_path);
       FATAL("Program '%s' not found or not executable", fname);
 
+    }
+
   } else {
 
     while (env_path) {
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index f43beb1b..21e18061 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -877,6 +877,7 @@ int main(int argc, char **argv_orig, char **envp) {
   if (stdin_file) ck_free(stdin_file);
 
   argv_cpy_free(argv);
+  if (fsrv->qemu_mode) free(use_argv[2]);
 
   exit(ret);