aboutsummaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'list.c')
-rw-r--r--list.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/list.c b/list.c
index 5a6c732..d18dae4 100644
--- a/list.c
+++ b/list.c
@@ -43,11 +43,9 @@ list_insert_next(struct list_item *list, T data)
43{ 43{
44 struct list_item *new_item; 44 struct list_item *new_item;
45 45
46 new_item = malloc(sizeof *new_item); 46 new_item = list_add(list->next, data);
47 if ( new_item ) { 47 if ( new_item ) {
48 new_item->data = data; 48 list->next = new_item;
49 new_item->next = list->next;
50 list->next = new_item;
51 } 49 }
52 else { 50 else {
53 ERROR("out of memory"); 51 ERROR("out of memory");