Appears to have been a copy paste error because this doesn't do what the api claims, and it also leaks the reference to the new node.

This commit is contained in:
William King 2013-05-24 19:35:43 -07:00
parent f3fd94b3e5
commit e2d6bc3340
1 changed files with 6 additions and 4 deletions

View File

@ -60,13 +60,15 @@ static amf0_data * amf0_list_insert_after(amf0_list * list, amf0_node * node, am
if (node != NULL) {
amf0_node * new_node = (amf0_node*)malloc(sizeof(amf0_node));
if (new_node != NULL) {
new_node->next = node->next;
new_node->prev = node;
if (node->next != NULL) {
node->next->prev = new_node;
node->next = new_node;
}
new_node->prev = node;
} else {
node->next = new_node;
new_node->prev = node;
}
if (node == list->last_element) {
list->last_element = new_node;
}