PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Bug Tracker

Reply
 
Thread Tools
Old 07-13-2006, 08:07 AM   #1
kwa1975
Green Mole
 
Join Date: Jul 2006
Posts: 1
Exclamation Memory Leak

In search_function.php about lines 277-284, one can read:
Code:
else {
    $num_exclude[$n] = $num_res_temp;
          while (list($spider_id,$weight) = mysql_fetch_array($result)) {
                 $s_exclude[$n][$spider_id] = 1;
          }
    mysql_free_result($result);
    }
}
It appears the MySQL results are not freed up in every case. I believe the intended code was:
Code:
else {
    $num_exclude[$n] = $num_res_temp;
          while (list($spider_id,$weight) = mysql_fetch_array($result)) {
                 $s_exclude[$n][$spider_id] = 1;
          }
    }
    mysql_free_result($result);
}
In fact, I wonder why the MySQL result is not freed a bit later, about lines 284-290:
Code:
      elseif (!isset($exclude[$n])) {
              $num_res[$n] = 0;
              $s_weight[$n][0] = 0;
     }
     mysql_free_result($result);
     $timer->stop('spider fills');
}
That memory leak might make some searches fail on some huge spider and sites databases.
kwa1975 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory usage? Dave A How-to Forum 0 01-25-2006 03:50 PM
Memory allocation error olivier External Binaries 6 02-17-2005 03:37 AM
running out of memory tomas External Binaries 11 02-19-2004 11:12 AM


All times are GMT -8. The time now is 05:22 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.