Bug #70573 [Asn->Csd]: Cloning SplPriorityQueue leads to memory leaks

From: Date: Thu, 24 Sep 2015 13:43:48 +0000
Subject: Bug #70573 [Asn->Csd]: Cloning SplPriorityQueue leads to memory leaks
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196210@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: Assigned +Status: Closed Type: Bug Package: SPL related Operating System: * PHP Version: 7.0Git-2015-09-24 (Git) Assigned To: dmitry Block user comment: N Private report: N New Comment: Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=415000ed93c6811cbceae3344d76ec63dbd7fff3 Log: Fixed bug #70573 (Cloning SplPriorityQueue leads to memory leaks) 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

« previous php.bugs (#196210) next »