bool srv_epmapper_delete_endpoints(struct pipes_struct *p)
{
struct epm_Delete r;
- struct dcesrv_ep_entry_list *el;
+ struct dcesrv_ep_entry_list *el = p->ep_entries;
error_status_t result;
- if (p->ep_entries == NULL) {
- return true;
- }
+ while (el) {
+ struct dcesrv_ep_entry_list *next = el->next;
- for (el = p->ep_entries;
- el != NULL;
- el = p->ep_entries) {
r.in.num_ents = el->num_ents;
r.in.entries = el->entries;
DLIST_REMOVE(p->ep_entries, el);
TALLOC_FREE(el);
+
+ el = next;
}
return true;
void srv_epmapper_cleanup(void)
{
- struct dcesrv_endpoint *ep;
+ struct dcesrv_endpoint *ep = endpoint_table;
+
+ while (ep) {
+ struct dcesrv_endpoint *next = ep->next;
- for (ep = endpoint_table;
- ep != NULL;
- ep = endpoint_table) {
DLIST_REMOVE(endpoint_table, ep);
TALLOC_FREE(ep);
+
+ ep = next;
}
}