diff options
author | hexcoder- <heiko@hexco.de> | 2020-11-17 20:09:52 +0100 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2020-11-17 20:09:52 +0100 |
commit | d042a63ab43545a5038fe46d11fef1bde8327028 (patch) | |
tree | 1906f613b4f37723932a5c9594bd09746f25d3ef /custom_mutators | |
parent | c06b5a156480d70e5013a780bb41bd074637475c (diff) | |
download | afl++-d042a63ab43545a5038fe46d11fef1bde8327028.tar.gz |
micro optimization: allocate only when needed
Diffstat (limited to 'custom_mutators')
-rw-r--r-- | custom_mutators/symcc/symcc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/custom_mutators/symcc/symcc.c b/custom_mutators/symcc/symcc.c index 9c6c0cb8..a609dafb 100644 --- a/custom_mutators/symcc/symcc.c +++ b/custom_mutators/symcc/symcc.c @@ -184,18 +184,18 @@ void afl_custom_queue_new_entry(my_mutator_t * data, struct stat st; u8 *source_name = alloc_printf("%s/%s", data->tmp_dir, nl[i]->d_name); - u8 *destination_name = - alloc_printf("%s/%s.%s", data->out_dir, origin_name, nl[i]->d_name); DBG("test=%s\n", fn); if (stat(source_name, &st) == 0 && S_ISREG(st.st_mode) && st.st_size) { + u8 *destination_name = + alloc_printf("%s/%s.%s", data->out_dir, origin_name, nl[i]->d_name); rename(source_name, destination_name); + ck_free(destination_name); DBG("found=%s\n", source_name); } ck_free(source_name); - ck_free(destination_name); free(nl[i]); } |