From: Anoop C S Date: Fri, 7 Oct 2016 10:35:29 +0000 (+0530) Subject: vfs_glusterfs: Fix a memory leak in connect path X-Git-Tag: samba-4.4.7~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15a8ee6ff29e498a2c19f7112b583975cea82146;p=thirdparty%2Fsamba.git vfs_glusterfs: Fix a memory leak in connect path Early return in case of failure to set snapdir-entry-path xlator option leaks talloced tmp_ctx. Signed-off-by: Anoop C S Reviewed-by: Guenther Deschner Reviewed-by: Andreas Schneider Autobuild-User(master): Günther Deschner Autobuild-Date(master): Fri Oct 7 19:39:11 CEST 2016 on sn-devel-144 Bug: https://bugzilla.samba.org/show_bug.cgi?id=12377 (cherry picked from commit 06281e8f1b912540a8cc2a79497b074dbe559d53) --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index b2ff4a9af6f..6548d7e3f36 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -222,8 +222,7 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle, if (ret < 0) { DEBUG(0, ("%s: Failed to set xlator option:" " snapdir-entry-path\n", volume)); - glfs_fini(fs); - return -1; + goto done; } ret = glfs_set_logging(fs, logfile, loglevel);