about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-11-06 10:02:53 +0100
committervanhauser-thc <vh@thc.org>2023-11-06 10:02:53 +0100
commit053334f35d0e8d6eace444781d52504585c69f76 (patch)
treea1cf2fbd879b1bd044ad64e34399a6725f98d8df
parent6ed3f4cfac52d2bef60321bccb236c7c5d215404 (diff)
downloadafl++-053334f35d0e8d6eace444781d52504585c69f76.tar.gz
fix lsan fix
-rw-r--r--src/afl-common.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 65932e26..ba498b3b 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -104,11 +104,19 @@ void set_sanitizer_defaults() {
 
     u8 buf[2048] = "";
     if (!have_san_options) { strcpy(buf, default_options); }
-    if (have_asan_options && NULL != strstr(have_asan_options, "detect_leaks=0")) {
-      strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=0:malloc_context_size=0:");
-    } else {
-      should_detect_leaks = 1;
-      strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=1:malloc_context_size=30:");
+    if (have_asan_options) {
+
+      if (NULL != strstr(have_asan_options, "detect_leaks=0")) {
+
+        strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=0:malloc_context_size=0:");
+
+      } else {
+
+        should_detect_leaks = 1;
+        strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=1:malloc_context_size=30:");
+
+      }
+
     }
 
     setenv("LSAN_OPTIONS", buf, 1);
@@ -120,9 +128,13 @@ void set_sanitizer_defaults() {
   if (!have_lsan_options) {
 
     if (should_detect_leaks) {
+
       strcat(default_options, "detect_leaks=1:malloc_context_size=30:");
+
     } else {
+
       strcat(default_options, "detect_leaks=0:malloc_context_size=0:");
+
     }
 
   }