From: Dmitry Stogov Date: Fri, 16 Feb 2007 08:33:28 +0000 (+0000) Subject: Fixed zend_llist_remove_tail (Michael Wallner) X-Git-Tag: php-5.2.2RC1~387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6a2b760dc7ab03b86391b26948a1a803eb72731;p=php Fixed zend_llist_remove_tail (Michael Wallner) --- diff --git a/NEWS b/NEWS index 27423b49cd..e73da6fc4d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS - Upgraded PCRE to version 7.0 (Nuno) - Add --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) +- Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) - Fixed bug #40467 (Partial SOAP request sent when XSD sequence or choice include minOccurs=0). (Dmitry) - Fixed bug #40465 (Ensure that all PHP elements are printed by var_dump). diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index 59cac8c62b..c79bd8f9b3 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -134,13 +134,15 @@ ZEND_API void *zend_llist_remove_tail(zend_llist *l) void *data; if ((old_tail = l->tail)) { - if (l->tail->prev) { - l->tail->prev->next = NULL; + if (old_tail->prev) { + old_tail->prev->next = NULL; + } else { + l->head = NULL; } data = old_tail->data; - l->tail = l->tail->prev; + l->tail = old_tail->prev; if (l->dtor) { l->dtor(data); }