PHP 4.0 Bug #1995: XML parser memory leaks
| From: | mlemos at acm dot org | Date: | Sun, 08 Aug 1999 02:27:11 +0000 |
| Subject: | PHP 4.0 Bug #1995: XML parser memory leaks | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9647@lists.php.net to get a copy of this message | ||
From: mlemos@acm.org
Operating system: Linux RH 5.2
PHP version: 4.0 Latest CVS (07/08/1999)
PHP Bug Type: Compile Failure
Bug description: XML parser memory leaks
I tried the following script and it got me the memory leak reports you may
see below:
<?
Function xml_parser_start_element_handler($parser,$name,$attrs)
{
}
Function xml_parser_end_element_handler($parser,$name)
{
}
Function xml_parser_character_data_handler($parser,$data)
{
}
if(($parser=xml_parser_create()))
{
xml_set_element_handler($parser,"xml_parser_start_element_handler","xml_parser_end_element_handler");
xml_set_character_data_handler($parser,"xml_parser_character_data_handler");
xml_parse($parser,"<TEST></TEST>",1);
}
?>
Script: 'test_xml.php'
---------------------------------------
xml.c(445) : Block 0x08161FA0 status:
Beginning: Cached (allocated on xml.c:105, 20 bytes)
End: OK
---------------------------------------
Script: 'test_xml.php'
---------------------------------------
xml.c(445) : Block 0x08161FE0 status:
Beginning: Cached (allocated on xml.c:129, 20 bytes)
End: OK
---------------------------------------
Script: 'test_xml.php'
---------------------------------------
xml.c(445) : Block 0x08162050 status:
Beginning: Cached (allocated on xml.c:706, 20 bytes)
End: OK
---------------------------------------
test_xml.php: Freeing 0x08162298 (40 bytes), allocated in zend_hash.c on line 175<br>
test_xml.php: Last leak repeated 1 time