[JENKINS-42670] - Fix the potential File descriptor leak in the Windows Service installer

This commit is contained in:
Oleg Nenashev committed 2017-03-10 15:33:32 +01:00
1 parent 2a97bf41fb
commit e63774decd
1 file changed
+3 -3
@@ -306,9 +306,9 @@ public class WindowsInstallerLink extends ManagementLink {
try {
return Kernel32Utils.waitForExitProcess(sei.hProcess);
} finally {
FileInputStream fin = new FileInputStream(new File(pwd,"redirect.log"));
IOUtils.copy(fin, out.getLogger());
fin.close();
try (FileInputStream fin = new FileInputStream(new File(pwd,"redirect.log"))) {
IOUtils.copy(fin, out.getLogger());
}
}
}