mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-09 08:41:32 +00:00
error handling, freeing mem
This commit is contained in:
parent
e9d2f72382
commit
38f1394e3a
@ -560,12 +560,14 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
if (lto_mode && !have_c) {
|
if (lto_mode && !have_c) {
|
||||||
|
|
||||||
u8 *ld_path = strdup(AFL_REAL_LD);
|
u8 *ld_path = strdup(AFL_REAL_LD);
|
||||||
if (!*ld_path) ld_path = "ld.lld";
|
if (!ld_path || !*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
|
#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 12
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("--ld-path=%s", ld_path);
|
cc_params[cc_par_cnt++] = alloc_printf("--ld-path=%s", ld_path);
|
||||||
#else
|
#else
|
||||||
cc_params[cc_par_cnt++] = alloc_printf("-fuse-ld=%s", ld_path);
|
cc_params[cc_par_cnt++] = alloc_printf("-fuse-ld=%s", ld_path);
|
||||||
#endif
|
#endif
|
||||||
|
free(ld_path);
|
||||||
|
|
||||||
cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition";
|
cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user