From: William King Date: Sat, 25 May 2013 02:42:02 +0000 (-0700) Subject: Fix improper handling of a double linked list that could have caused a memory leak. X-Git-Tag: v1.2.13~335 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83ae82fd2d85afa6af785a5ff95ddea6e7b0dcce;p=thirdparty%2Ffreeswitch.git Fix improper handling of a double linked list that could have caused a memory leak. --- diff --git a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c index 9914d5ab21..d6230d3f0b 100644 --- a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c +++ b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c @@ -40,11 +40,13 @@ static amf0_data * amf0_list_insert_before(amf0_list * list, amf0_node * node, a if (new_node != NULL) { new_node->next = node; new_node->prev = node->prev; - + if (node->prev != NULL) { node->prev->next = new_node; - node->prev = new_node; } + + node->prev = new_node; + if (node == list->first_element) { list->first_element = new_node; }