diff options
author | Dominik Maier <dmnk@google.com> | 2022-03-31 15:35:38 +0000 |
---|---|---|
committer | Dominik Maier <dmnk@google.com> | 2022-03-31 15:36:26 +0000 |
commit | 285a5cb38b994b514744c49bad409a49210765d4 (patch) | |
tree | 3c2b194865469a57ec40de886a7b0737eec799f0 /src/afl-cc.c | |
parent | 51dbd0e9571db5404b7c74169965367800b093db (diff) | |
download | afl++-285a5cb38b994b514744c49bad409a49210765d4.tar.gz |
Some scan-build fixes
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r-- | src/afl-cc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c index 4cec7740..ffdda386 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -566,7 +566,19 @@ static void edit_params(u32 argc, char **argv, char **envp) { } - if (!ld_path || !*ld_path) { ld_path = strdup("ld.lld"); } + if (!ld_path || !*ld_path) { + + if (ld_path) { + + // Freeing empty string + free(ld_path); + + } + + ld_path = strdup("ld.lld"); + + } + if (!ld_path) { PFATAL("Could not allocate mem for ld_path"); } #if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 12 cc_params[cc_par_cnt++] = alloc_printf("--ld-path=%s", ld_path); |