[PATCH] Fix double free in sg engine error path
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 09:47:48 +0000 (10:47 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 09:47:48 +0000 (10:47 +0100)
We need to clear td->io_ops->data if we free the structure,
otherwise the ->cleanup() handler will try to free it again.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/fio-engine-sg.c

index e0748892e1ed216b4a9837e0278cce1a2c98d3b5..3ea1e289604ba6159bf9e3c3f92b3b8d0000ee92 100644 (file)
@@ -311,6 +311,7 @@ err:
        free(sd->events);
        free(sd->cmds);
        free(sd);
+       td->io_ops->data = NULL;
        return 1;
 }