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>
/*
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;
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,
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);
}