fio: replace malloc+memset with calloc
[fio.git] / filesetup.c
index 8e5059412ed5e82c396d0f87a87523a2e61f1c4c..14c7610849218194c475366d8fe2f641084fa6ba 100644 (file)
@@ -303,13 +303,12 @@ static bool pre_read_file(struct thread_data *td, struct fio_file *f)
        if (bs > left)
                bs = left;
 
-       b = malloc(bs);
+       b = calloc(1, bs);
        if (!b) {
                td_verror(td, errno, "malloc");
                ret = false;
                goto error;
        }
-       memset(b, 0, bs);
 
        if (lseek(f->fd, f->file_offset, SEEK_SET) < 0) {
                td_verror(td, errno, "lseek");