php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2109 Memory leak in each()
Submitted: 1999-08-19 19:24 UTC Modified: 1999-08-23 15:09 UTC
From: christophe dot massiot at mail dot dotcom dot fr Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (19/08/1999) OS: Linux 2.0.36/Debian slink
Private report: No CVE-ID: None
 [1999-08-19 19:24 UTC] christophe dot massiot at mail dot dotcom dot fr
The following script :

<?
class foo {
function affiche_dict() {
  $this->dict[date_message] = $toto;
  while (list($key, $val) = each($this->dict)) {}
}
}
  $bar = new foo;
  $err = $bar->affiche_dict();
?>

produces :

1:22 [webase3:p3] titi:~/html% php test.php
Content-Type: text/html

test.php:  Freeing 0x080F0308 (41 bytes), allocated in zend_hash.c on line 175<br>
test.php:  Freeing 0x080F02B8 (35 bytes), allocated in zend_hash.c on line 380<br>
test.php:  Freeing 0x080F5D48 (4 bytes), allocated in zend_hash.c on line 391<br>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-23 15:09 UTC] andi at cvs dot php dot net
Fixed in latest CVS. Thanks for the bug report.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 20 22:01:29 2020 UTC