[FIXED JENKINS-18351] file descriptor leak while fingerprinting

This commit is contained in:
Christoph Kutzinski committed 2013-06-14 18:36:08 +02:00
1 parent 0e1bc560ae
commit 93c31be1b7
2 files changed
+9 -1

No files matched your search

+6 -1
View File
@@ -1664,7 +1664,12 @@ public final class FilePath implements Serializable {
return act(new FileCallable<String>() {
private static final long serialVersionUID = 1L;
public String invoke(File f, VirtualChannel channel) throws IOException {
return Util.getDigestOf(new BufferedInputStream(new FileInputStream(f)));
BufferedInputStream source = new BufferedInputStream(new FileInputStream(f));
try {
return Util.getDigestOf(source);
} finally {
source.close();
}
}
});
}