aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-11-17 20:09:52 +0100
committerhexcoder- <heiko@hexco.de>2020-11-17 20:09:52 +0100
commitd042a63ab43545a5038fe46d11fef1bde8327028 (patch)
tree1906f613b4f37723932a5c9594bd09746f25d3ef
parentc06b5a156480d70e5013a780bb41bd074637475c (diff)
downloadafl++-d042a63ab43545a5038fe46d11fef1bde8327028.tar.gz
micro optimization: allocate only when needed
-rw-r--r--custom_mutators/symcc/symcc.c6
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]);
}