diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-11-15 16:53:32 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:14 -0500 |
commit | 3c6b9db18f064fe1e2907352b23809832168e00f (patch) | |
tree | 90b975777cb8fda661af5cd018ab1f2861843658 /source4/ldap_server | |
parent | 132b046ec833072bb29fc01aa6e063eee63090da (diff) | |
download | samba-3c6b9db18f064fe1e2907352b23809832168e00f.tar.gz samba-3c6b9db18f064fe1e2907352b23809832168e00f.tar.bz2 samba-3c6b9db18f064fe1e2907352b23809832168e00f.zip |
r19722: fix memory leaks and hierachie bugs
metze
(This used to be commit fddcbf5d4cce77705be43956ea93895432b64aa1)
Diffstat (limited to 'source4/ldap_server')
-rw-r--r-- | source4/ldap_server/ldap_backend.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index 05b263204e..1a2206b831 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -198,7 +198,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call) } if (req->num_attributes >= 1) { - attrs = talloc_array(samdb, const char *, req->num_attributes+1); + attrs = talloc_array(local_ctx, const char *, req->num_attributes+1); NT_STATUS_HAVE_NO_MEMORY(attrs); for (i=0; i < req->num_attributes; i++) { @@ -368,7 +368,8 @@ static NTSTATUS ldapsrv_ModifyRequest(struct ldapsrv_call *call) msg->elements[i].num_values = req->mods[i].attrib.num_values; if (msg->elements[i].num_values > 0) { - msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg->elements, struct ldb_val, + msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { @@ -456,7 +457,8 @@ static NTSTATUS ldapsrv_AddRequest(struct ldapsrv_call *call) if (req->attributes[i].num_values > 0) { msg->elements[i].num_values = req->attributes[i].num_values; - msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg->elements, struct ldb_val, + msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { @@ -671,7 +673,7 @@ reply: if (result == LDAP_SUCCESS) { ldb_ret = ldb_search(samdb, dn, LDB_SCOPE_BASE, filter, attrs, &res); - talloc_steal(samdb, res); + talloc_steal(local_ctx, res); if (ldb_ret != LDB_SUCCESS) { result = map_ldb_error(samdb, ldb_ret, &errstr); DEBUG(10,("CompareRequest: error: %s\n", errstr)); |