Bug #70573 [Opn->Asn]: Cloning SplPriorityQueue leads to memory leaks
| From: | dmitry@php.net | Date: | Thu, 24 Sep 2015 13:41:03 +0000 |
| Subject: | Bug #70573 [Opn->Asn]: Cloning SplPriorityQueue leads to memory leaks | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196212@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70573&edit=1
ID: 70573
Updated by: dmitry@php.net
Reported by: dmitry at zend dot com
Summary: Cloning SplPriorityQueue leads to memory leaks
-Status: Open
+Status: Assigned
Type: Bug
Package: SPL related
Operating System: *
PHP Version: 7.0Git-2015-09-24 (Git)
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-09-24 13:40:25] dmitry at zend dot com
Description:
------------
Wrong code in spl_heap_object_new_ex() increments reference counters of elements twice.
Test script:
---------------
<?php
$q1 = new SplPriorityQueue();
$a = 1;
$q1->insert([$a], 1);
$q1->insert([$a], 2);
$q2 = clone $q1;
echo "ok\n";
?>
Expected result:
----------------
ok
[without memory leaks]
Actual result:
--------------
ok
[memory leaks]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70573&edit=1