about summary refs log tree commit diff
path: root/llvm_mode/afl-clang-fast.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-10 10:24:24 +0200
committervan Hauser <vh@thc.org>2020-05-10 10:24:24 +0200
commit2e553bcd69a6852e7feb7e87ce757babfcb26df0 (patch)
tree32685901018d74c8c1835d3d275d2cfb24e05dc0 /llvm_mode/afl-clang-fast.c
parent0e5a5f18050d729bc79e4dd5203ca245aa532d85 (diff)
downloadafl++-2e553bcd69a6852e7feb7e87ce757babfcb26df0.tar.gz
code-format
Diffstat (limited to 'llvm_mode/afl-clang-fast.c')
-rw-r--r--llvm_mode/afl-clang-fast.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index 027f4035..07754d1d 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -337,16 +337,18 @@ static void edit_params(u32 argc, char **argv, char **envp) {
   // e.g. compiled download or compiled from github then it's ./lib directory
   // might not be in the search path. Add it if so.
   u8 *libdir = strdup(LLVM_LIBDIR);
-  if (strlen(libdir) && strncmp(libdir, "/usr", 4) &&
+  if (cpp_mode && strlen(libdir) && strncmp(libdir, "/usr", 4) &&
       strncmp(libdir, "/lib", 4)) {
 
     cc_params[cc_par_cnt++] = "-rpath";
     cc_params[cc_par_cnt++] = libdir;
 
-  } else
+  } else {
 
     free(libdir);
 
+  }
+
   /* Detect stray -v calls from ./configure scripts. */
 
   while (--argc) {