From:             adam at trachtenberg dot com
Operating system: *
PHP version:      5CVS-2004-01-13 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Memory leak when passing arguments to __clone()

Description:
------------
Passing arguments to __clone() causes a memory leak. (I 
know this is invalid.)

Reproduce code:
---------------
class foo {
    function __clone() {}
}

$a = new foo;
$b = $a->__clone('bad argument');

Expected result:
----------------
No leaks.

Actual result:
--------------
PHP Warning:  Clone method does not require arguments in 
/Users/adam/php5/clone.php on line 8
/usr/local/cvs/php/php-src/Zend/zend_execute.c(2817) :  
Freeing 0x00B98C30 (16 bytes), script=./clone.php
/usr/local/cvs/php/php-src/Zend/zend_execute.c(2820) :  
Freeing 0x00B98AD0 (13 bytes), script=./clone.php
/usr/local/cvs/php/php-src/Zend/zend_variables.c(137) : 
Actual location (location was relayed)
=== Total 2 memory leaks detected ===

-- 
Edit bug report at http://bugs.php.net/?id=26900&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26900&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26900&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26900&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26900&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26900&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26900&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26900&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26900&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26900&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26900&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26900&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26900&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26900&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26900&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26900&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26900&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26900&r=float

Reply via email to