PHP 4.0 Bug #1990: memory leak in switch() statement
| From: | danny dot heijl at cevi dot be | Date: | Sat, 07 Aug 1999 20:28:23 +0000 |
| Subject: | PHP 4.0 Bug #1990: memory leak in switch() statement | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9632@lists.php.net to get a copy of this message | ||
From: danny.heijl@cevi.be
Operating system: RH 5.2 Linux
PHP version: 4.0 Latest CVS (07/08/1999)
PHP Bug Type: Scripting Engine problem
Bug description: memory leak in switch() statement
The following script (/php3/test/lang/021.php3t) leaks memory :
<?php
for ($i=0; $i<=5; $i++)
{
echo "i=$i\n";
switch($i) {
case 0:
echo "In branch 0\n";
break;
case 1:
echo "In branch 1\n";
break;
case 2:
echo "In branch 2\n";
break;
case 3:
echo "In branch 3\n";
break 2;
case 4:
echo "In branch 4\n";
break;
default:
echo "In default\n";
break;
}
}
echo "hi\n";
?>
Content-Type: text/html
i=0
In branch 0
i=1
In branch 1
i=2
In branch 2
i=3
In branch 3
hi
/tmp/switch1.php3: Freeing 0x08215948 (37 bytes), allocated in zend_hash.c on line 175<br>
Same goes for test/lang/022.php3t and test/lang/023.php3t