From e1b4df414f9e6689589eb247f99bb20742a4cefc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 May 2017 15:45:57 -0700 Subject: [PATCH] s4: ntvfs: Add a TALLOC_CTX * paramter to pvfs_acl_register() Make use of the passed in TALLOC_CTX * from the init function to remove a talloc_autofree_context() use. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source4/ntvfs/posix/pvfs_acl.c | 5 +++-- source4/ntvfs/posix/pvfs_acl_nfs4.c | 2 +- source4/ntvfs/posix/pvfs_acl_xattr.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c index 9a110caf236..d284585f260 100644 --- a/source4/ntvfs/posix/pvfs_acl.c +++ b/source4/ntvfs/posix/pvfs_acl.c @@ -41,7 +41,7 @@ static int num_backends; The 'name' can be later used by other backends to find the operations structure for this backend. */ -NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops) +NTSTATUS pvfs_acl_register(TALLOC_CTX *ctx, const struct pvfs_acl_ops *ops) { struct pvfs_acl_ops *new_ops; @@ -50,7 +50,8 @@ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops) return NT_STATUS_OBJECT_NAME_COLLISION; } - backends = talloc_realloc(talloc_autofree_context(), backends, struct pvfs_acl_backend, num_backends+1); + backends = talloc_realloc(ctx, backends, + struct pvfs_acl_backend, num_backends+1); NT_STATUS_HAVE_NO_MEMORY(backends); new_ops = (struct pvfs_acl_ops *)talloc_memdup(backends, ops, sizeof(*ops)); diff --git a/source4/ntvfs/posix/pvfs_acl_nfs4.c b/source4/ntvfs/posix/pvfs_acl_nfs4.c index 392dc92fe12..b07d2ba9b41 100644 --- a/source4/ntvfs/posix/pvfs_acl_nfs4.c +++ b/source4/ntvfs/posix/pvfs_acl_nfs4.c @@ -195,5 +195,5 @@ NTSTATUS pvfs_acl_nfs4_init(TALLOC_CTX *ctx) .acl_load = pvfs_acl_load_nfs4, .acl_save = pvfs_acl_save_nfs4 }; - return pvfs_acl_register(&ops); + return pvfs_acl_register(ctx, &ops); } diff --git a/source4/ntvfs/posix/pvfs_acl_xattr.c b/source4/ntvfs/posix/pvfs_acl_xattr.c index 648c459dadd..1f569ca43f3 100644 --- a/source4/ntvfs/posix/pvfs_acl_xattr.c +++ b/source4/ntvfs/posix/pvfs_acl_xattr.c @@ -100,5 +100,5 @@ NTSTATUS pvfs_acl_xattr_init(TALLOC_CTX *ctx) .acl_load = pvfs_acl_load_xattr, .acl_save = pvfs_acl_save_xattr }; - return pvfs_acl_register(&ops); + return pvfs_acl_register(ctx, &ops); } -- 2.11.4.GIT