*(cursor->first) = vp->next;
cursor->current = vp->next;
cursor->next = vp->next ? vp->next->next : NULL;
+ before = NULL;
goto fixup;
}
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