From: Jens Axboe Date: Thu, 3 Jul 2014 21:30:37 +0000 (-0600) Subject: glusterfs: fix leak in error path X-Git-Tag: fio-2.1.11~23 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=93782cbbd8c8ab46bdc1f18b8a99c740ae6954e5 glusterfs: fix leak in error path Signed-off-by: Jens Axboe --- diff --git a/engines/glusterfs.c b/engines/glusterfs.c index a64c687f..52006b04 100644 --- a/engines/glusterfs.c +++ b/engines/glusterfs.c @@ -77,16 +77,12 @@ int fio_gf_setup(struct thread_data *td) } 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; }