PHP 4.0 Bug #3473: Memory leaks when using regex in a 2d array.
| From: | caps at bmw dot org | Date: | Sun, 13 Feb 2000 12:06:21 +0000 |
| Subject: | PHP 4.0 Bug #3473: Memory leaks when using regex in a 2d array. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15485@lists.php.net to get a copy of this message | ||
From: caps@bmw.org
Operating system: Linux 2.2.15 (RH 5.2)
PHP version: 4.0 Beta 3
PHP Bug Type: Other
Bug description: Memory leaks when using regex in a 2d array.
When using the next script PHP leaks memory,
for ($i=0;$i<count($Users);$i++) {
$Branche = "";
for ($B=2;$B<count($Users[$i]);$B++)
$Branche.=$Users[$i][$B];
$Users[$i][1] = str_replace(",",".",$Users[$i][1]);
$Users[$i][1] = ereg_replace("[ !#\$%\^&\*\(\)]","", $Users[$i][1]);
$Login=substr(ereg_replace("[,\. !#\$%\^&\*\(\)]","", $Users[$i][0]),0,7);
$Query=sprintf("INSERT INTO EmailService
VALUES ('%s', '%s', PASSWORD('%s'), 0, NULL, '%s',
'111111111111', '%s')",
$Users[$i][0], $Users[$i][1], $Users[$i][1], $Branche, strtolower($Login));
$id=mysql_query("$Query");
print "Done!";
This results in :
Done!
reg.c(487) : Freeing 0x08106E90 (1 bytes), script=Convert.php3
string.c(1549) : Freeing 0x08105BC8 (1 bytes), script=Convert.php3
Logan5 told me to post this, so here you are:-)