|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3473 Memory leaks when using regex in a 2d array.
Submitted: 2000-02-13 13:06 UTC Modified: 2000-08-20 01:50 UTC
From: caps at bmw dot org Assigned:
Status: Closed Package: Other
PHP Version: 4.0 Beta 3 OS: Linux 2.2.15 (RH 5.2)
Private report: No CVE-ID: None
 [2000-02-13 13:06 UTC] caps at bmw dot org
When using the next script PHP leaks memory,

for ($i=0;$i<count($Users);$i++) {

$Branche = "";

for ($B=2;$B<count($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));


print "Done!";

This results in :


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:-)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-01 23:26 UTC]
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-08-20 01:50 UTC]
No feedback from user.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Apr 01 08:03:37 2023 UTC