|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-11 08:25 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 04:00:02 2025 UTC |
Description: ------------ A memory leak occurs if an exception is thrown within a switch($var) block The leak does not occur if the switch is made on a constant [eg switch(5)] Occurs in 5.0.5, but not in 5.1.1 It *does* however still appear in 5.0-CVS (2006-01-11) -- maybe the bug was 'accidentally' fixed in 5.1; I couldn't find any reference to it in the bugs list. If it was a deliberatel fix in 5.1, can the fix be backported to the 5.0 tree too? Reproduce code: --------------- #!/usr/local/src/php5/php-5.0CVS/php-src/sapi/cli/php <? try { $x = 0; switch ($x) { default: throw new Exception('bad thing happened'); } } catch (Exception $z) { } ?> Expected result: ---------------- Nothing Actual result: -------------- With --enable-debug: /usr/local/src/php5/php-5.0CVS/php-src/Zend/zend_execute.c(675) : Freeing 0x09A4C354 (16 byt es), script=./tX.php5 === Total 1 memory leaks detected ===