summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-06-21 08:06:28 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-01 11:23:56 +0200
commit6aff8b19fcdbf694cc8dbd388f87e55cce475939 (patch)
treea214947fa9b8d2496ec84af0abf0fa2a9ce8f5c7
parent796c7ab282f11ad46bb5e90d721c54223045540f (diff)
downloadsamba-6aff8b19fcdbf694cc8dbd388f87e55cce475939.tar.gz
samba-6aff8b19fcdbf694cc8dbd388f87e55cce475939.tar.xz
samba-6aff8b19fcdbf694cc8dbd388f87e55cce475939.zip
s3:smbldap: add a destructor to smbldap_state, just in case
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/lib/smbldap.c7
1 files changed, 7 insertions, 0 deletions
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;
}