From d042a63ab43545a5038fe46d11fef1bde8327028 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Tue, 17 Nov 2020 20:09:52 +0100 Subject: micro optimization: allocate only when needed --- custom_mutators/symcc/symcc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'custom_mutators/symcc') 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]); } -- cgit 1.4.1