A potential bug of file descriptor leak (2)
Closed this issue · 0 comments
ash1852 commented
hello,I found a potentil bug of file descriptor leak in source code of dynamips , would you help me check whether this bug is ture?thank you for your effort and patience very much.
step 1 :
In file dynamips/stable/ppc32.c , function ppc32_load_raw_image line 488 :
Function fopen64 executes and stores the return value to bfd
step 2 :
In file dynamips/stable/ppc32.c , function ppc32_load_raw_image line 488 :
Select the false branch at this point (bfd==null is false)
step 3 :
In file dynamips/stable/ppc32.c , function ppc32_load_raw_image line 493 :
Select the true branch at this point (fstat64(fileno(bfd),file_info)==(-1) is true) but did not close it