1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-10 04:23:50 +03:00

r7593: simplified the memory management in the ldap code. Having a mem_ctx

element in a structure is not necessary any more.
(This used to be commit 912d0427f5)
This commit is contained in:
Andrew Tridgell
2005-06-15 00:27:51 +00:00
committed by Gerald (Jerry) Carter
parent 74a3621089
commit c0947b0d7f
13 changed files with 156 additions and 154 deletions

View File

@@ -90,6 +90,9 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
attrs[i] = NULL;
}
DEBUG(5,("ldb_search_bytree dn=%s filter=%s\n",
basedn->dn, ldb_filter_from_tree(call, r->tree)));
count = ldb_search_bytree(samdb, basedn->dn, scope, r->tree, attrs, &res);
talloc_steal(samdb, res);
@@ -97,7 +100,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
ent_r = ldapsrv_init_reply(call, LDAP_TAG_SearchResultEntry);
NT_STATUS_HAVE_NO_MEMORY(ent_r);
ent = &ent_r->msg.r.SearchResultEntry;
ent = &ent_r->msg->r.SearchResultEntry;
ent->dn = talloc_steal(ent_r, res[i]->dn);
ent->num_attributes = 0;
ent->attributes = NULL;
@@ -151,7 +154,7 @@ reply:
}
}
done = &done_r->msg.r.SearchResultDone;
done = &done_r->msg->r.SearchResultDone;
done->dn = NULL;
done->resultcode = result;
done->errormessage = (errstr?talloc_strdup(done_r,errstr):NULL);
@@ -250,7 +253,7 @@ reply:
}
}
add_result = &add_reply->msg.r.AddResponse;
add_result = &add_reply->msg->r.AddResponse;
add_result->dn = NULL;
add_result->resultcode = result;
add_result->errormessage = (errstr?talloc_strdup(add_reply,errstr):NULL);
@@ -302,7 +305,7 @@ reply:
}
}
del_result = &del_reply->msg.r.DelResponse;
del_result = &del_reply->msg->r.DelResponse;
del_result->dn = NULL;
del_result->resultcode = result;
del_result->errormessage = (errstr?talloc_strdup(del_reply,errstr):NULL);
@@ -412,7 +415,7 @@ reply:
}
}
modify_result = &modify_reply->msg.r.AddResponse;
modify_result = &modify_reply->msg->r.AddResponse;
modify_result->dn = NULL;
modify_result->resultcode = result;
modify_result->errormessage = (errstr?talloc_strdup(modify_reply,errstr):NULL);
@@ -481,7 +484,7 @@ reply:
}
}
compare = &compare_r->msg.r.CompareResponse;
compare = &compare_r->msg->r.CompareResponse;
compare->dn = NULL;
compare->resultcode = result;
compare->errormessage = (errstr?talloc_strdup(compare_r,errstr):NULL);
@@ -578,7 +581,7 @@ reply:
}
}
modifydn = &modifydn_r->msg.r.ModifyDNResponse;
modifydn = &modifydn_r->msg->r.ModifyDNResponse;
modifydn->dn = NULL;
modifydn->resultcode = result;
modifydn->errormessage = (errstr?talloc_strdup(modifydn_r,errstr):NULL);