Skip to content

Commit

Permalink
Merge pull request #2793 from oleg-nenashev/bug/JENKINS-42670-Windows…
Browse files Browse the repository at this point in the history
…InstallerLink_leak

[JENKINS-42670] - Fix the potential File descriptor leak in the Windows Service installer
  • Loading branch information
oleg-nenashev committed Mar 11, 2017
2 parents 6e39dd3 + e63774d commit 3544af8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java
Expand Up @@ -306,9 +306,9 @@ static int runElevated(File jenkinsExe, String command, TaskListener out, File p
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());
}
}
}

Expand Down

0 comments on commit 3544af8

Please sign in to comment.