Fix node comparison on delete
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Apr 2010 02:59:26 +0000 (04:59 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 Apr 2010 08:52:48 +0000 (10:52 +0200)
This could be the cause of bug #35.

src/lib/hash.c

index 0780259..b7bbf09 100644 (file)
@@ -243,14 +243,7 @@ static int list_delete(fr_hash_table_t *ht,
        last = head;
 
        for (cur = *head; cur != &ht->null; cur = cur->next) {
-               if (cur == node) {
-                       if (ht->cmp) {
-                               int cmp = ht->cmp(node->data, cur->data);
-                               if (cmp > 0) break;
-                               if (cmp < 0) continue;
-                       }
-                       break;
-               }
+               if (cur == node) break;
                last = &(cur->next);
        }