From: Alan T. DeKok Date: Tue, 15 Dec 2015 21:50:40 +0000 (-0500) Subject: better fix for #1456 X-Git-Tag: release_3_0_11~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bb37e83348f8bdbafd02e93ab94ffa707508172;p=thirdparty%2Ffreeradius-server.git better fix for #1456 --- diff --git a/src/lib/cursor.c b/src/lib/cursor.c index 89cf34c2d93..ae88ebe75bd 100644 --- a/src/lib/cursor.c +++ b/src/lib/cursor.c @@ -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; } @@ -413,9 +414,10 @@ 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