php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1995 XML parser memory leaks
Submitted: 1999-08-07 22:27 UTC Modified: 1999-08-08 07:38 UTC
From: mlemos at acm dot org Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0 Latest CVS (07/08/1999) OS: Linux RH 5.2
Private report: No CVE-ID: None
 [1999-08-07 22:27 UTC] mlemos at acm dot org
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-08 07:38 UTC] thies at cvs dot php dot net
fixed in CVS
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC