Fix leaking file handle
Merge pull request #6 from xaqq/master

Fix leaking file handle