Edit report at https://bugs.php.net/bug.php?id=64515&edit=1

 ID:                 64515
 Patch added by:     larue...@php.net
 Reported by:        hannes dot magnusson at gmail dot com
 Summary:            Memoryleak when using the same variablename 2times
                     in function declaration
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   MacOSX
 PHP Version:        5.4Git-2013-03-25 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug64515.patch
Revision:   1364267611
URL:        
https://bugs.php.net/patch-display.php?bug=64515&patch=bug64515.patch&revision=1364267611


Previous Comments:
------------------------------------------------------------------------
[2013-03-25 20:46:37] hannes dot magnusson at gmail dot com

Description:
------------
There is a memory leak when the same argument name is used 2 times in a 
function 
declaration.

Test script:
---------------
<?php
function foo($unused = null, $unused = null, $bar = array()) {
    return 1;
}
foo();

Actual result:
--------------
==67447== 32 bytes in 1 blocks are definitely lost in loss record 17 of 94
==67447==    at 0x4DC7: malloc (vg_replace_malloc.c:266)
==67447==    by 0x1002800CE: _emalloc (zend_alloc.c:2423)
==67447==    by 0x100318565: ZEND_RECV_INIT_SPEC_CONST_HANDLER 
(zend_vm_execute.h:1358)
==67447==    by 0x100300796: execute (zend_vm_execute.h:410)
==67447==    by 0x1002BFCBA: zend_execute_scripts (zend.c:1315)
==67447==    by 0x1002108AF: php_execute_script (main.c:2492)
==67447==    by 0x10037E106: do_cli (php_cli.c:988)
==67447==    by 0x10037CE3A: main (php_cli.c:1364)


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64515&edit=1

Reply via email to