List *
list_alloc (void)
{
- return calloc(1, sizeof(List));
+ return checked_calloc(sizeof(List));
}
/**
{
void *current = slice;
slice = *(void**) (current + next_offset);
- free(current);
+ checked_free(current);
}
}
void
list_free_1 (List *list)
{
- free(list);
+ checked_free(list);
}
/**
List *new_list;
List *last;
- new_list = malloc(sizeof(List));
+ new_list = checked_malloc(sizeof(List));
new_list->data = data;
new_list->next = NULL;
{
List *new_list;
- new_list = malloc(sizeof(List));
+ new_list = checked_malloc(sizeof(List));
new_list->data = data;
new_list->next = list;
if (!tmp_list)
return list_append(list, data);
- new_list = malloc(sizeof(List));
+ new_list = checked_malloc(sizeof(List));
new_list->data = data;
new_list->prev = tmp_list->prev;
tmp_list->prev->next = new_list;
list_delete_link (List *list, List *link_)
{
list = _list_remove_link(list, link_);
- free(link_);
+ checked_free(link_);
return list;
}
{
List *last;
- new_list = malloc(sizeof(List));
+ new_list = checked_malloc(sizeof(List));
if (func)
new_list->data = func (list->data, user_data);
while (list)
{
- last->next = malloc(sizeof(List));
+ last->next = checked_malloc(sizeof(List));
last->next->prev = last;
last = last->next;