[PATCH] Missing memset and free-on-error in io engines
[fio.git] / engines / fio-engine-posixaio.c
index 401cd866ba549ee193098f3af54998c6e6aef2fd..894a410a459117571518c00b66abe2d790a81183 100644 (file)
@@ -171,7 +171,9 @@ static int fio_posixaio_init(struct thread_data *td)
 {
        struct posixaio_data *pd = malloc(sizeof(*pd));
 
 {
        struct posixaio_data *pd = malloc(sizeof(*pd));
 
+       memset(pd, 0, sizeof(*pd));
        pd->aio_events = malloc(td->iodepth * sizeof(struct io_u *));
        pd->aio_events = malloc(td->iodepth * sizeof(struct io_u *));
+       memset(pd->aio_events, 0, td->iodepth * sizeof(struct io_u *));
 
        td->io_ops->data = pd;
        return 0;
 
        td->io_ops->data = pd;
        return 0;