117 {
118
119 if (item == NULL) {
120
121 return;
122 }
123
124 if (item == list->head) {
125 if (list->head == list->tail) {
126 list->head = NULL;
127 list->tail = NULL;
128 } else {
129 list->head = list->head->next;
130 }
131
132 if (list->free_item_fn) {
133 list->free_item_fn(item->
data);
134 }
137 free(item);
138 } else if (item == list->tail) {
139 for (
ListItem *i = list->head; i != NULL; i = i->
next) {
140 if (i->next == list->tail) {
141 list->tail = i;
142 i->next = NULL;
143
144 if (list->free_item_fn) {
145 list->free_item_fn(item->
data);
146 }
149 free(item);
150 }
151 }
152 } else {
153 if (list->free_item_fn) {
154 list->free_item_fn(item->
data);
155 }
156
158
161
164
165 if (tmp == list->tail) {
166 list->tail = item;
167 }
168
169 free(tmp);
170 }
171
172 list->length--;
173}
#define insecure_memzero(buf, len)