fixed some potential file descriptor leaks
Merge pull request #179 from z0mbiehunt3r/upstream

fixed some potential file descriptor leaks