fix a resource leak for remote URLs
Merge pull request #142 from tmorton/fix-resource-leak

fix a resource leak for remote URLs