s4: ntvfs: Add a TALLOC_CTX * to sys_lease_register().
authorJeremy Allison <jra@samba.org>
Thu, 11 May 2017 22:49:28 +0000 (15:49 -0700)
committerRalph Boehme <slow@samba.org>
Sat, 13 May 2017 14:50:13 +0000 (16:50 +0200)
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>
source4/ntvfs/sysdep/sys_lease.c
source4/ntvfs/sysdep/sys_lease.h
source4/ntvfs/sysdep/sys_lease_linux.c

index 3db67030a1fb32e9b30090b24fbb5dfcef1cf869..b6e6ffc9af6bc71201d50fe539d9fd5324b3f4c6 100644 (file)
@@ -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;
index 57a5e0a35fc47ce034699c21bd770b460977d882..8b8d4bdd8829b4addaca0f742149fada61aa845e 100644 (file)
@@ -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,
index 1c70f4e1a6f97e571ee45cf3b361e609c2fc6baa..566a9a3aaef6a1484d41d6b329ad87cdffcbe341 100644 (file)
@@ -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);
 }