Fix access of freed memory
[fio.git] / log.c
diff --git a/log.c b/log.c
index 4a64132c82e85569a6c9e52850251efb7364d36a..6117b702c49e4fa345dad601362f65085362ee32 100644 (file)
--- a/log.c
+++ b/log.c
@@ -133,7 +133,8 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                        get_file(io_u->file);
                        dprint(FD_IO, "iolog: get %llu/%lu/%s\n", io_u->offset,
                                                io_u->buflen, io_u->file->file_name);
-                       if (ipo->delay) iolog_delay(td, ipo->delay);
+                       if (ipo->delay)
+                               iolog_delay(td, ipo->delay);
                } else {
                        elapsed = mtime_since_genesis();
                        if (ipo->delay > elapsed)
@@ -143,7 +144,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
 
                free(ipo);
                
-               if (ipo->ddir != DDIR_WAIT)
+               if (io_u->ddir != DDIR_WAIT)
                        return 0;
        }