]> granicus.if.org Git - php/commitdiff
Revert "Remove a useless memory write in zend_llist_del_element"
authorPierrick Charron <pierrick@php.net>
Wed, 26 Dec 2012 15:13:56 +0000 (10:13 -0500)
committerPierrick Charron <pierrick@php.net>
Wed, 26 Dec 2012 15:13:56 +0000 (10:13 -0500)
This reverts commit fad960a4045da86cdbd8308a165ffc47892f05b9 as
required by Stas and Christopher

Zend/zend_llist.c

index 26baf4d958cf0e114cc61e4a847f5bf63828e847..4656420781d0f05c725fdd82980507df48e1f2a0 100644 (file)
@@ -91,13 +91,15 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element)
 ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2))
 {
        zend_llist_element *current=l->head;
+       zend_llist_element *next;
 
        while (current) {
+               next = current->next;
                if (compare(current->data, element)) {
                        DEL_LLIST_ELEMENT(current, l);
                        break;
                }
-               current = current->next;
+               current = next;
        }
 }