diff options
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)); |