[php-src] PR #22539: ext/dom: Fix double-free of namespaces on OOM during parsing.
| From: | devnexen | Date: | Wed, 01 Jul 2026 17:37:01 +0000 |
| Subject: | [php-src] PR #22539: ext/dom: Fix double-free of namespaces on OOM during parsing. | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36763@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22539
Author: devnexen
Fix #22522
php_dom_ns_compat_mark_attribute_list() cleared node->nsDef only after moving every namespace
onto doc->oldNs, so a bailout mid-loop (e.g. OOM) left both lists owning the same namespaces,
double-freeing them on teardown. Move each namespace to oldNs before the allocating calls so it is
only ever owned by one list.