[php-src] PR #23464: Fix leak when iterating IntlBreakIterator parts iterators
| From: | iliaal | Date: | Tue, 25 Aug 2026 23:15:28 +0000 |
| Subject: | [php-src] PR #23464: Fix leak when iterating IntlBreakIterator parts iterators | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38145@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23464
Author: iliaal
Iterating IntlBreakIterator::getPartsIterator() leaked memory on every loop because the
IntlPartsIterator held a counted self-reference through its embedded zend_object_iterator's
wrapping_obj, so refcount destruction could never complete, and the retained current element was
additionally never released at iterator destruction. zoi_with_current_dtor() now invalidates the
current element and the parts iterator leaves wrapping_obj UNDEF as the plain BreakIterator iterator
already does, making teardown deterministic; the string enumeration iterator keeps its
self-reference because move_forward and rewind need the owner for error handling.