/*
* This has to be done in a mutex lock, because talloc
* isn't thread-safe.
- *
- * We also COPY the VPs instead of moving them. This is
- * because moving does a talloc_steal(), which keeps the
- * parent context around.
*/
if (entry) {
- VALUE_PAIR *vps;
-
- vps = fr_pair_list_copy_by_num(request, entry->vps, 0, 0, TAG_ANY);
- fr_pair_list_move(request, &request->state, &vps);
- fr_pair_list_free(&entry->vps);
-
+ fr_pair_list_move_by_num(request, &request->state, &entry->vps, 0, 0, TAG_ANY);
RDEBUG2("session-state: Found cached attributes");
rdebug_pair_list(L_DBG_LVL_1, request, request->state, NULL);
/*
* This has to be done in a mutex lock, because talloc
* isn't thread-safe.
- *
- * We also COPY the VPs instead of moving them. This is
- * because moving does a talloc_steal(), which keeps the
- * parent context around.
*/
- entry->vps = fr_pair_list_copy_by_num(request, request->state, 0, 0, TAG_ANY);
- fr_pair_list_free(&request->state);
+ fr_pair_list_move_by_num(entry, &entry->vps, &request->state, 0, 0, TAG_ANY);
PTHREAD_MUTEX_UNLOCK(&state->mutex);
rad_assert(request->state == NULL);