Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

fs.readFile may leak an fd when fstat() fails #7697

Closed
piscisaureus opened this issue May 28, 2014 · 0 comments
Closed

fs.readFile may leak an fd when fstat() fails #7697

piscisaureus opened this issue May 28, 2014 · 0 comments

Comments

@piscisaureus
Copy link

https://github.com/joyent/node/blob/4394c8a9b3889436fa957ea52955936a2640407b/lib/fs.js#L232

The fd should be closed before making the callback.

piscisaureus pushed a commit that referenced this issue May 29, 2014
Currently, if fstat() fails in readFile(), the callback
is invoked without closing the file. This commit closes
the file before calling back.

Closes #7697
piscisaureus pushed a commit that referenced this issue May 29, 2014
Currently, if fstat() fails in readFile(), the callback
is invoked without closing the file. This commit closes
the file before calling back.

Closes #7697
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant