/* destroy any handles */
while (p->handles) {
- TALLOC_CTX *m = p->handles->mem_ctx;
- DLIST_REMOVE(p->handles, p->handles);
- talloc_destroy(m);
+ dcesrv_handle_destroy(p, p->handles);
}
talloc_destroy(p->mem_ctx);
struct policy_handle wire_handle;
TALLOC_CTX *mem_ctx;
void *data;
+ void (*destroy)(struct dcesrv_connection *, struct dcesrv_handle *);
};
/* hold the authentication state information */
}
h->mem_ctx = mem_ctx;
h->data = NULL;
+ h->destroy = NULL;
h->wire_handle.handle_type = handle_type;
uuid_generate_random(&h->wire_handle.uuid);
void dcesrv_handle_destroy(struct dcesrv_connection *dce_conn,
struct dcesrv_handle *h)
{
+ if (h->destroy) {
+ h->destroy(dce_conn, h);
+ }
DLIST_REMOVE(dce_conn->handles, h);
talloc_destroy(h->mem_ctx);
}