summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-18 10:00:40 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-08-18 10:08:43 +1000
commitf37793ef0aa31eec9a6e619b55fa07c3025fcac6 (patch)
tree5c0d43355d0097616006175e619cb547f6d96ccc /source4/ldap_server
parent23dc2e4244a99f1e955d54c22516a7a8c108d989 (diff)
downloadsamba-f37793ef0aa31eec9a6e619b55fa07c3025fcac6.tar.gz
samba-f37793ef0aa31eec9a6e619b55fa07c3025fcac6.tar.bz2
samba-f37793ef0aa31eec9a6e619b55fa07c3025fcac6.zip
s4:ldap_server use talloc_unlink() to avoid talloc_free() with references
Both the session_info and the ldb can have references. Andrew Bartlett
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_bind.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c
index 1b235f2a1b..c97211cb2c 100644
--- a/source4/ldap_server/ldap_bind.c
+++ b/source4/ldap_server/ldap_bind.c
@@ -63,12 +63,12 @@ static NTSTATUS ldapsrv_BindSimple(struct ldapsrv_call *call)
result = LDAP_SUCCESS;
errstr = NULL;
- talloc_free(call->conn->session_info);
+ talloc_unlink(call->conn, call->conn->session_info);
call->conn->session_info = session_info;
talloc_steal(call->conn, session_info);
/* don't leak the old LDB */
- talloc_free(call->conn->ldb);
+ talloc_unlink(call->conn, call->conn->ldb);
status = ldapsrv_backend_Init(call->conn);
@@ -234,11 +234,11 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
"SASL:[%s]: Failed to get session info: %s",
req->creds.SASL.mechanism, nt_errstr(status));
} else {
- talloc_free(old_session_info);
+ talloc_unlink(conn, old_session_info);
talloc_steal(conn, conn->session_info);
/* don't leak the old LDB */
- talloc_free(conn->ldb);
+ talloc_unlink(conn, conn->ldb);
status = ldapsrv_backend_Init(conn);