The Samba-Bugzilla – Attachment 14189 Details for
Bug 13424
vfs_ceph: Memory leak in realpath operation.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.8.next
0001-s3-VFS-Fix-memory-leak-in-vfs_ceph.patch (text/plain), 2.09 KB, created by
Jeremy Allison
on 2018-05-09 17:13:36 UTC
(
hide
)
Description:
git-am fix for 4.8.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2018-05-09 17:13:36 UTC
Size:
2.09 KB
patch
obsolete
>From a1da8e76f768f268d02651b30cef0e04416c9022 Mon Sep 17 00:00:00 2001 >From: Vandana Rungta <vrungta@amazon.com> >Date: Tue, 8 May 2018 11:27:47 -0700 >Subject: [PATCH] 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@amazon.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >Reviewed-by: David Disseldorp <ddiss@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed May 9 04:28:11 CEST 2018 on sn-devel-144 > >(cherry picked from commit 4e78aeedb8329953df83fc7f2c191b2c97a051d0) >--- > source3/modules/vfs_ceph.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > >diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c >index 656ce57009f..61df5dedf82 100644 >--- a/source3/modules/vfs_ceph.c >+++ b/source3/modules/vfs_ceph.c >@@ -1252,30 +1252,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, >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
ddiss
:
review+
Actions:
View
Attachments on
bug 13424
: 14189