php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40899 memory leak when nesting list()
Submitted: 2007-03-23 07:31 UTC Modified: 2007-03-23 12:48 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: cweiske at cweiske dot de Assigned: dmitry
Status: Closed Package: Arrays related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID:
 [2007-03-23 07:31 UTC] cweiske at cweiske dot de
Description:
------------
I get memory leaks when nesting list() statements to assign array variables to local variables. I get no leaks if list() is not nested.

Reproduce code:
---------------
php -a
Interactive shell

php > list(list($a,$b),$c)=array(array('a','b'),'c');
php > quit



Expected result:
----------------
Nothing.

Actual result:
--------------
[Fri Mar 23 08:28:26 2007]  Script:  '-'
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_vm_execute.h(3533) :  Freeing 0x08923060 (16 bytes), script=-
Last leak repeated 1 time
[Fri Mar 23 08:28:26 2007]  Script:  '-'
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_vm_execute.h(6308) :  Freeing 0x0892323C (16 bytes), script=-
[Fri Mar 23 08:28:26 2007]  Script:  '-'
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_vm_execute.h(3578) :  Freeing 0x08923620 (44 bytes), script=-
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_API.c(819) : Actual location (location was relayed)
Last leak repeated 1 time
[Fri Mar 23 08:28:26 2007]  Script:  '-'
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_variables.h(45) :  Freeing 0x089236C4 (2 bytes), script=-
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_variables.c(120) : Actual location (location was relayed)
Last leak repeated 1 time
[Fri Mar 23 08:28:26 2007]  Script:  '-'
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_vm_execute.h(3564) :  Freeing 0x089236F4 (35 bytes), script=-
/var/tmp/portage/dev-lang/php-5.2.1-r3/work/php-5.2.1/Zend/zend_hash.c(388) : Actual location (location was relayed)
Last leak repeated 1 time
=== Total 9 memory leaks detected ===

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-23 12:48 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_2.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC