From: Jens Axboe Date: Wed, 19 Aug 2020 18:10:26 +0000 (-0600) Subject: init: add_job() needs to use right file freeing functions X-Git-Tag: fio-3.23~25 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4b5da010ac92c99dc455bacc2d60620236528f89;p=fio.git init: add_job() needs to use right file freeing functions Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 6ff7c68d..3073c2a0 100644 --- a/init.c +++ b/init.c @@ -1736,9 +1736,17 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, if (td_new->files) { struct fio_file *f; for_each_file(td_new, f, i) { - if (f->file_name) - sfree(f->file_name); - sfree(f); + bool use_smalloc = fio_file_smalloc(f); + if (f->file_name) { + if (use_smalloc) + sfree(f->file_name); + else + free(f->file_name); + } + if (use_smalloc) + sfree(f); + else + free(f); } free(td_new->files); td_new->files = NULL;