From 6aff8b19fcdbf694cc8dbd388f87e55cce475939 Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Tue, 21 Jun 2011 08:06:28 +0200 Subject: [PATCH] s3:smbldap: add a destructor to smbldap_state, just in case Signed-off-by: Stefan Metzmacher --- source3/lib/smbldap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index 41ba0e1b442..1fbefbf2d59 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -1853,6 +1853,12 @@ void smbldap_free_struct(struct smbldap_state **ldap_state) /* No need to free any further, as it is talloc()ed */ } +static int smbldap_state_destructor(struct smbldap_state *state) +{ + smbldap_free_struct(&state); + return 0; +} + /********************************************************************** Intitalise the 'general' ldap structures, on which ldap operations may be conducted @@ -1876,6 +1882,7 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, (*smbldap_state)->event_context = event_ctx; + talloc_set_destructor(*smbldap_state, smbldap_state_destructor); return NT_STATUS_OK; } -- 2.34.1