From:             hannes dot magnusson at gmail dot com
Operating system: FreeBSD
PHP version:      5CVS-2006-08-30 (CVS)
PHP Bug Type:     Scripting Engine problem
Bug description:  Memory leak

Description:
------------
This little code snippet leaks..

Reproduce code:
---------------
<?php
class foo {
    const cons = 10;
}

class bar extends foo {
}

$foo = new ReflectionClass("foo");
$foo->getConstant("cons");


Actual result:
--------------
==73146== 16 bytes in 1 blocks are definitely lost in loss 
record 1 of 2
==73146==    at 0x3C03C18B: malloc 
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==73146==    by 0x81A4EAF: _emalloc (zend_alloc.c:1628)
==73146==    by 0x81DBFF3: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:182)
==73146==    by 0x81DCAD0: 
ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:322)
==73146==    by 0x81DBD01: execute (zend_vm_execute.h:92)
==73146==    by 0x81BE198: zend_execute_scripts 
(zend.c:1095)
==73146==    by 0x8178454: php_execute_script (main.c:1759)
==73146==    by 0x82236C0: main (php_cli.c:1102)

-- 
Edit bug report at http://bugs.php.net/?id=38653&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38653&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38653&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38653&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38653&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38653&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38653&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38653&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38653&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38653&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38653&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38653&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38653&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38653&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38653&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38653&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38653&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38653&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38653&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38653&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38653&r=mysqlcfg

Reply via email to