summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-11 15:49:28 -0700
committerRalph Boehme <slow@samba.org>2017-05-13 16:50:13 +0200
commitf0d8913a0f795657200c18807bd3855eef5fb6e0 (patch)
tree69837c5521728eda1768da121135abb2784dd3a0 /source4/ntvfs
parente1b4df414f9e6689589eb247f99bb20742a4cefc (diff)
downloadsamba-f0d8913a0f795657200c18807bd3855eef5fb6e0.tar.gz
s4: ntvfs: Add a TALLOC_CTX * to sys_lease_register().
Pass in the TALLOC_CTX * from the module init to remove another talloc_autofree_context() use. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/sysdep/sys_lease.c5
-rw-r--r--source4/ntvfs/sysdep/sys_lease.h2
-rw-r--r--source4/ntvfs/sysdep/sys_lease_linux.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/source4/ntvfs/sysdep/sys_lease.c b/source4/ntvfs/sysdep/sys_lease.c
index 3db67030a1f..b6e6ffc9af6 100644
--- a/source4/ntvfs/sysdep/sys_lease.c
+++ b/source4/ntvfs/sysdep/sys_lease.c
@@ -103,10 +103,11 @@ _PUBLIC_ struct sys_lease_context *sys_lease_context_create(struct share_config
/*
register a lease backend
*/
-_PUBLIC_ NTSTATUS sys_lease_register(const struct sys_lease_ops *backend)
+_PUBLIC_ NTSTATUS sys_lease_register(TALLOC_CTX *ctx,
+ const struct sys_lease_ops *backend)
{
struct sys_lease_ops *b;
- b = talloc_realloc(talloc_autofree_context(), backends,
+ b = talloc_realloc(ctx, backends,
struct sys_lease_ops, num_backends+1);
NT_STATUS_HAVE_NO_MEMORY(b);
backends = b;
diff --git a/source4/ntvfs/sysdep/sys_lease.h b/source4/ntvfs/sysdep/sys_lease.h
index 57a5e0a35fc..8b8d4bdd882 100644
--- a/source4/ntvfs/sysdep/sys_lease.h
+++ b/source4/ntvfs/sysdep/sys_lease.h
@@ -47,7 +47,7 @@ struct sys_lease_context {
const struct sys_lease_ops *ops;
};
-NTSTATUS sys_lease_register(const struct sys_lease_ops *ops);
+NTSTATUS sys_lease_register(TALLOC_CTX *ctx, const struct sys_lease_ops *ops);
NTSTATUS sys_lease_init(void);
struct sys_lease_context *sys_lease_context_create(struct share_config *scfg,
diff --git a/source4/ntvfs/sysdep/sys_lease_linux.c b/source4/ntvfs/sysdep/sys_lease_linux.c
index 1c70f4e1a6f..566a9a3aaef 100644
--- a/source4/ntvfs/sysdep/sys_lease_linux.c
+++ b/source4/ntvfs/sysdep/sys_lease_linux.c
@@ -211,5 +211,5 @@ static struct sys_lease_ops linux_lease_ops = {
NTSTATUS sys_lease_linux_init(TALLOC_CTX *ctx)
{
/* register ourselves as a system lease module */
- return sys_lease_register(&linux_lease_ops);
+ return sys_lease_register(ctx, &linux_lease_ops);
}