forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Because the use of RETURN instead of RETVAL, the freeing code could not be executed. This only is triggerable if the content of the attribute is mixed text and entities, so it wasn't noticed earlier.
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
GH-17145 (DOM memory leak) | ||
--EXTENSIONS-- | ||
dom | ||
--CREDITS-- | ||
YuanchengJiang | ||
--FILE-- | ||
<?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')); | ||
echo $attr->value; | ||
?> | ||
--EXPECT-- | ||
n& |