fs: fix ReadStream fd leak
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 11 Dec 2012 13:45:45 +0000 (14:45 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 12 Dec 2012 08:46:22 +0000 (09:46 +0100)
commit6e97b2cc17851a3b96cd01bac40c82573650ce6b
treeed596edbddcfcb528bd509715e28b44abcbc1c28
parent65d824b488793ba8b92dfcf6edc6e87f41745580
fs: fix ReadStream fd leak

Close the file descriptor when a read operation fails.

Fixes #4387.
lib/fs.js
test/simple/test-fs-read-stream-err.js [new file with mode: 0644]