glusterfs: fix leak in error path
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/engines/glusterfs.c b/engines/glusterfs.c
index a64c687..52006b0 100644
--- a/engines/glusterfs.c
+++ b/engines/glusterfs.c
@@ -77,16 +77,12 @@
}
dprint(FD_FILE, "fio setup %p\n", g->fs);
td->io_ops->data = g;
+ return 0;
cleanup:
- if (r) {
- if (g) {
- if (g->fs) {
- glfs_fini(g->fs);
- }
- free(g);
- td->io_ops->data = NULL;
- }
- }
+ if (g->fs)
+ glfs_fini(g->fs);
+ free(g);
+ td->io_ops->data = NULL;
return r;
}