From: William King Date: Sat, 25 May 2013 02:35:43 +0000 (-0700) Subject: Appears to have been a copy paste error because this doesn't do what the api claims... X-Git-Tag: v1.2.13~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3aea787300f1fe2407dc5c91ea79bc2046a6a6e;p=thirdparty%2Ffreeswitch.git 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. --- diff --git a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c index 4fed720469..9914d5ab21 100644 --- a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c +++ b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c @@ -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; }