By the horrible hack of making a copy of the input list.
The issue is that the expansions need access to the input list,
but we also need to re-write the input list in radius_pairmove()
So until we have a better fix, we'll just do this hack
vp_cursor_t cursor;
VALUE_PAIR *vp, *next, **last;
VALUE_PAIR **from_list, **to_list;
+ VALUE_PAIR *to_copy;
bool *edited = NULL;
REQUEST *fixup = NULL;
+ TALLOC_CTX *ctx;
if (!request) return;
}
to_count = 0;
- for (vp = *to; vp != NULL; vp = next) {
+ ctx = talloc_parent(*to);
+ to_copy = paircopy(ctx, *to);
+ for (vp = to_copy; vp != NULL; vp = next) {
next = vp->next;
to_list[to_count++] = vp;
vp->next = NULL;
/*
* Re-chain the "to" list.
*/
- *to = NULL;
+ pairfree(to);
last = to;
if (to == &request->packet->vps) {