#38234 [Opn->Asn]: Exception in __clone makes memory leak
| From: | dmitry@php.net | Date: | Thu, 27 Jul 2006 10:25:36 +0000 |
| Subject: | #38234 [Opn->Asn]: Exception in __clone makes memory leak | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99992@lists.php.net to get a copy of this message | ||
ID: 38234
Updated by: dmitry@php.net
Reported By: dmitry@php.net
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2006-07-27 (CVS)
-Assigned To:
+Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2006-07-27 10:25:21] dmitry@php.net
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