Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Three Potential Bugs of File Descriptor Leak #27

Open
ash1852 opened this issue Sep 18, 2021 · 1 comment
Open

[BUG]Three Potential Bugs of File Descriptor Leak #27

ash1852 opened this issue Sep 18, 2021 · 1 comment

Comments

@ash1852
Copy link

ash1852 commented Sep 18, 2021

hello , I found three potential bugs of file descriptor leak,would you help me check if these bugs are true?Thank you for your patience and effort.

==============================================================================

step 1 :
In file ht/tools/bin2c.c , function main line 162 :
Function fopen64 executes and stores the return value to out

step 2 :
In file ht/tools/bin2c.c , function main line 163 :
Select the true branch at this point (out!=null is true)
step 3 :
In file ht/tools/bin2c.c , function main lines after line 163
no statement close out

==============================================================================

step 1 :
In file ht/tools/bin2c.c , function main line 157 :
Function fopen64 executes and stores the return value to outh

step 2 :
In file ht/tools/bin2c.c , function main line 158 :
Select the true branch at this point (outh!=null is true)

step 3 :
In file ht/tools/bin2c.c , function main lines after line 158:
no statement close outh

==============================================================================

step 1 :
In file ht/tools/bin2c.c , function main line 140 :
Function fopen executes and stores the return value to in

step 2 :
In file ht/tools/bin2c.c , function main line 141 :
Select the true branch at this point (in!=null is true)

step 3 :
In file ht/tools/bin2c.c , function main lines after line 141:
no statement close in

@rdoeffinger
Copy link

This is the main function of a tiny tool. There is no point in closing the files, as the runtime/OS are required to do it.
It can make sense to add them anyway just on principle and to make various tools like the one you used happy, but it's no bug not to close them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants