[SCM] Samba Shared Repository - branch v4-7-test updated

Karolin Seeger kseeger at samba.org
Thu May 17 16:19:02 UTC 2018


The branch, v4-7-test has been updated
       via  4dc19ac s3: VFS: Fix memory leak in vfs_ceph.
      from  91edd9c winbindd: Do re-connect if the RPC call fails in the passdb case

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 4dc19aced2c2d5b44a4c89e64c0445953911e917
Author: Vandana Rungta <vrungta at amazon.com>
Date:   Tue May 8 11:27:47 2018 -0700

    s3: VFS: Fix memory leak in vfs_ceph.
    
    Centralize error handling.
    
    https://bugzilla.samba.org/show_bug.cgi?id=13424
    
    Signed-off-by: Vandana Rungta <vrungta at amazon.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed May  9 04:28:11 CEST 2018 on sn-devel-144
    
    (cherry picked from commit 4e78aeedb8329953df83fc7f2c191b2c97a051d0)
    
    Autobuild-User(v4-7-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-7-test): Thu May 17 18:18:42 CEST 2018 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_ceph.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index a27b762..9f75283 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1355,30 +1355,31 @@ static struct smb_filename *cephwrap_realpath(struct vfs_handle_struct *handle,
 				TALLOC_CTX *ctx,
 				const struct smb_filename *smb_fname)
 {
-	char *result;
+	char *result = NULL;
 	const char *path = smb_fname->base_name;
 	size_t len = strlen(path);
 	struct smb_filename *result_fname = NULL;
+	int r = -1;
 
-	result = SMB_MALLOC_ARRAY(char, PATH_MAX+1);
 	if (len && (path[0] == '/')) {
-		int r = asprintf(&result, "%s", path);
-		if (r < 0) return NULL;
+		r = asprintf(&result, "%s", path);
 	} else if ((len >= 2) && (path[0] == '.') && (path[1] == '/')) {
 		if (len == 2) {
-			int r = asprintf(&result, "%s",
+			r = asprintf(&result, "%s",
 					handle->conn->connectpath);
-			if (r < 0) return NULL;
 		} else {
-			int r = asprintf(&result, "%s/%s",
+			r = asprintf(&result, "%s/%s",
 					handle->conn->connectpath, &path[2]);
-			if (r < 0) return NULL;
 		}
 	} else {
-		int r = asprintf(&result, "%s/%s",
+		r = asprintf(&result, "%s/%s",
 				handle->conn->connectpath, path);
-		if (r < 0) return NULL;
 	}
+
+	if (r < 0) {
+		return NULL;
+	}
+
 	DBG_DEBUG("[CEPH] realpath(%p, %s) = %s\n", handle, path, result);
 	result_fname = synthetic_smb_fname(ctx,
 				result,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list