Skip to content

Commit fcafe4d

Browse files
committed
update last at the last minute. Fixes #5680
1 parent b4f307f commit fcafe4d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/lib/hash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,8 @@ static int list_insert(fr_hash_table_t *ht,
214214

215215
last = head;
216216

217-
for (cur = *head; cur != &ht->null; cur = cur->next) {
217+
for (cur = *head; cur != &ht->null; last = &(cur->next), cur = cur->next) {
218218
if (cur->reversed > node->reversed) break;
219-
last = &(cur->next);
220219

221220
if (cur->reversed == node->reversed) {
222221
if (ht->cmp) {

0 commit comments

Comments
 (0)