php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70573 Cloning SplPriorityQueue leads to memory leaks
Submitted: 2015-09-24 13:40 UTC Modified: 2015-09-24 13:40 UTC
From: dmitry at zend dot com Assigned: dmitry
Status: Closed Package: SPL related
PHP Version: 7.0Git-2015-09-24 (Git) OS: *
Private report: No CVE-ID:
 [2015-09-24 13:40 UTC] 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]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-24 13:40 UTC] dmitry@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2015-09-24 13:43 UTC] dmitry@php.net
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)
 [2015-09-24 13:43 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2015-09-29 13:10 UTC] ab@php.net
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)
 [2016-07-20 11:36 UTC] davey@php.net
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)
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Wed Feb 22 15:01:37 2017 UTC