Two Review requests

Dmitry Samersoff Dmitry.Samersoff at oracle.com
Fri Sep 28 12:12:14 PDT 2012


John,

> File Descriptor Leak:
> http://cr.openjdk.java.net/~chegar/8000203/webrev.00/
> (Jira bug ID number: 8000203)

(*it's not to your changes but as far as you touch this code *)

607  else is not needed here

609  realloc should not touch original pointer in case of fail,
     so this code leads to hidden memmory leak

     its better to do:

       newLoRoutes = realloc(
       if (newLoRoutes == NULL){

         // What you do here depends to whether you
         // plan to keep incomplete table or not.

          free(loRoutes);
          break;
       }


-Dmitry


On 2012-09-28 18:11, John Zavgren wrote:
> Greetings:
> 
> I just posted the webrev images for two networking code bugs:
> 
> File Descriptor Leak:
> http://cr.openjdk.java.net/~chegar/8000203/webrev.00/
> (Jira bug ID number: 8000203)
> 
> Uninitialized memory:
> http://cr.openjdk.java.net/~chegar/8000206/webrev.00/
> (Jira bug ID: 8000206)
> This change doesn't actually fix a bug... the original code initialized "optlen" before it was referenced, however, parfait (static code analysis) believes "optlen" MAY be used before initialization. I added the assignment statement to "spoof" parfait, and it no longer flags a bug. I assume it's better to put minor harmless tweaks in our code than to add state information to parfait, that would cause it to ignore certain "situations". That option seems complicated and dangerous.
> 
> Thanks!
> John Zavgren
> john.zavgren at oracle.com
> 


-- 
Dmitry Samersoff
Java Hotspot development team, SPB04
* There will come soft rains ...



More information about the net-dev mailing list