ID: 38234
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2006-07-27 (CVS)
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_2.
Previous Comments:
------------------------------------------------------------------------
[2006-07-27 10:25:21] [EMAIL PROTECTED]
Description:
------------
PHP makes a memory leak in case if script throws exception from inside
__clone() method.
Reproduce code:
---------------
<?php
class Foo {
function __clone() {
throw new Exception();
}
}
try {
$x = new Foo();
$y = clone $x;
} catch (Exception $e) {
}
echo "ok\n";
?>
Expected result:
----------------
ok
Actual result:
--------------
ok
[Thu Jul 27 14:21:47 2006] Script: 'x.php'
/home/dmitry/php/php5.2/Zend/zend_vm_execute.h(19949) : Freeing
0xB7ECBFF8 (16 bytes), script=x.php
=== Total 1 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38234&edit=1