]> git.puffer.fish Git - mirror/frr.git/commitdiff
[lib] list_delete shouldn't duplicate list_delete_all_node
authorPaul Jakma <paul.jakma@sun.com>
Thu, 15 Jun 2006 12:43:09 +0000 (12:43 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Thu, 15 Jun 2006 12:43:09 +0000 (12:43 +0000)
2006-06-15 Paul Jakma <paul.jakma@sun.com>

* linklist.c: (list_delete) call list_delete_all_node, don't
  duplicate it.

lib/ChangeLog
lib/linklist.c

index b7c9f0403500318fe702b3e1f85a1c30f42d0561..a9c3b8bfd0d949d9d812764c03a48c247e6b2d44 100644 (file)
@@ -3,6 +3,8 @@
        * command.c: (cmd_describe_command_real) Fix leak, CID #38.
        * memory.h: Experimental, have XFREE macro NULL out the freed
          pointer.
+       * linklist.c: (list_delete) call list_delete_all_node, don't
+         duplicate it.
 
 2006-05-28 Paul Jakma <paul.jakma@sun.com>
 
index 71c4db8202e26d7142c67c229db22e2130d40cce..11e16a8a4af61e505aef4461d2e1e4bee203db79 100644 (file)
@@ -226,17 +226,8 @@ list_delete_all_node (struct list *list)
 void
 list_delete (struct list *list)
 {
-  struct listnode *node;
-  struct listnode *next;
-
   assert(list);
-  for (node = list->head; node; node = next)
-    {
-      next = node->next;
-      if (list->del)
-       (*list->del) (node->data);
-      listnode_free (node);
-    }
+  list_delete_all_node (list);
   list_free (list);
 }