Because nr_files and new_size are not same types.It can cause new_size less than zero.Then realloc will be failed. Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx> --- filesetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index 324e9a6..c55ff3f 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1074,7 +1074,7 @@ int add_file(struct thread_data *td, const char *fname) fio_file_reset(f); if (td->files_size <= td->files_index) { - int new_size = td->o.nr_files + 1; + unsigned int new_size = td->o.nr_files + 1; dprint(FD_FILE, "resize file array to %d files\n", new_size); td->files = realloc(td->files, new_size * sizeof(f)); -- 1.7.9.5 ?韬{.n?????%??檩??w?{.n?????^n?■???h?璀?{?夸z罐?+€?zf"?????i?????_璁?:+v??撸?