diff options
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/epmapper/srv_epmapper.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index 3c12b3caa2..2e3e5d2173 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -231,16 +231,12 @@ static bool is_priviledged_pipe(struct auth_serversupplied_info *info) { 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; @@ -254,6 +250,8 @@ bool srv_epmapper_delete_endpoints(struct pipes_struct *p) DLIST_REMOVE(p->ep_entries, el); TALLOC_FREE(el); + + el = next; } return true; @@ -261,13 +259,15 @@ bool srv_epmapper_delete_endpoints(struct pipes_struct *p) 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; } } |