### Description The following code: ```php <?php $element = new DOMElement("N", "W", "y"); $attr = new DOMAttr("c" , "n"); $doc = new DOMDocument(); $doc->appendChild($element); $element->setAttributeNodeNS($attr); $attr->appendChild($doc->createEntityReference('amp')); var_dump(get_defined_vars()); ``` Resulted in this output: ``` ==423827==ERROR: LeakSanitizer: detected memory leaks Direct leak of 6 byte(s) in 3 object(s) allocated from: #0 0x6807fd in malloc (/home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php+0x6807fd) #1 0x7f5aae2356e3 in xmlStrndup (/lib/x86_64-linux-gnu/libxml2.so.2+0xe36e3) SUMMARY: AddressSanitizer: 6 byte(s) leaked in 3 allocation(s). ``` ### PHP Version nightly ### Operating System ubuntu 22.04
Activity
devnexen commentedon Dec 13, 2024
might be a libxml2 version issue ? cc @nielsdos
ndossche commentedon Dec 13, 2024
Good guess, but for once this is caused by an issue in PHP, it's a stupid typo in this case.
Fix phpGH-17145: DOM memory leak
Merge branch 'PHP-8.4'
Fix GH-17145: DOM memory leak