fix leak open file descriptors
Merge pull request #1 from zver/master

fix leak open file descriptors