mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-10-19 04:38:32 +00:00
[lib] list_delete shouldn't duplicate list_delete_all_node
2006-06-15 Paul Jakma <paul.jakma@sun.com> * linklist.c: (list_delete) call list_delete_all_node, don't duplicate it.
This commit is contained in:
parent
8ce5cfd13e
commit
c024fd0c76
@ -3,6 +3,8 @@
|
|||||||
* command.c: (cmd_describe_command_real) Fix leak, CID #38.
|
* command.c: (cmd_describe_command_real) Fix leak, CID #38.
|
||||||
* memory.h: Experimental, have XFREE macro NULL out the freed
|
* memory.h: Experimental, have XFREE macro NULL out the freed
|
||||||
pointer.
|
pointer.
|
||||||
|
* linklist.c: (list_delete) call list_delete_all_node, don't
|
||||||
|
duplicate it.
|
||||||
|
|
||||||
2006-05-28 Paul Jakma <paul.jakma@sun.com>
|
2006-05-28 Paul Jakma <paul.jakma@sun.com>
|
||||||
|
|
||||||
|
@ -226,17 +226,8 @@ list_delete_all_node (struct list *list)
|
|||||||
void
|
void
|
||||||
list_delete (struct list *list)
|
list_delete (struct list *list)
|
||||||
{
|
{
|
||||||
struct listnode *node;
|
|
||||||
struct listnode *next;
|
|
||||||
|
|
||||||
assert(list);
|
assert(list);
|
||||||
for (node = list->head; node; node = next)
|
list_delete_all_node (list);
|
||||||
{
|
|
||||||
next = node->next;
|
|
||||||
if (list->del)
|
|
||||||
(*list->del) (node->data);
|
|
||||||
listnode_free (node);
|
|
||||||
}
|
|
||||||
list_free (list);
|
list_free (list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user