Skip to content

Commit

Permalink
better fix for #1456
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 15, 2015
1 parent 9f5f6f3 commit 1bb37e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ VALUE_PAIR *fr_cursor_remove(vp_cursor_t *cursor)
*(cursor->first) = vp->next;
cursor->current = vp->next;
cursor->next = vp->next ? vp->next->next : NULL;
before = NULL;
goto fixup;
}

Expand All @@ -413,9 +414,10 @@ VALUE_PAIR *fr_cursor_remove(vp_cursor_t *cursor)
vp->next = NULL; /* limit scope of fr_pair_list_free() */

/*
* Fixup cursor->found if we removed the VP it was referring to
* Fixup cursor->found if we removed the VP it was referring to,
* and point to the previous one.
*/
if (vp == cursor->found) cursor->found = cursor->current;
if (vp == cursor->found) cursor->found = before;

/*
* Fixup cursor->last if we removed the VP it was referring to
Expand Down

0 comments on commit 1bb37e8

Please sign in to comment.