From 16ce55584512274804eadd71b4790be3d1bfbf97 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 17 Apr 2020 07:52:21 +0200 Subject: fixed 2 unimportant leaks --- qemu_mode/build_qemu_support.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'qemu_mode/build_qemu_support.sh') 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 -- cgit 1.4.1 From 8fa5d4c313372a337c7facf0428b0339babbe057 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 17 Apr 2020 11:01:14 +0200 Subject: clearer code --- qemu_mode/build_qemu_support.sh | 1 + src/afl-common.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'qemu_mode/build_qemu_support.sh') diff --git a/qemu_mode/build_qemu_support.sh b/qemu_mode/build_qemu_support.sh index 118f6ebd..c512396a 100755 --- a/qemu_mode/build_qemu_support.sh +++ b/qemu_mode/build_qemu_support.sh @@ -234,6 +234,7 @@ if [ "$ORIG_CPU_TARGET" = "" ]; then unset AFL_INST_RATIO + echo "[*] Comparing two afl-showmap -Q outputs..." 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..48efff2c 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -222,10 +222,12 @@ char **get_qemu_argv(u8 *own_loc, u8 **target_path_p, int argc, char **argv) { } - } else + } else { ck_free(own_copy); + } + if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) { if (cp) ck_free(cp); @@ -389,16 +391,19 @@ u8 *find_binary(u8 *fname) { memcpy(cur_elem, env_path, delim - env_path); delim++; - } else + } else { cur_elem = ck_strdup(env_path); + } + env_path = delim; - if (cur_elem[0]) + if (cur_elem[0]) { target_path = alloc_printf("%s/%s", cur_elem, fname); - else + } else { target_path = ck_strdup(fname); + } ck_free(cur_elem); -- cgit 1.4.1