Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-43930] - Fatal file leak on exceptional path when redi…
Browse files Browse the repository at this point in the history
…rect.log is not writable
  • Loading branch information
oleg-nenashev committed Apr 28, 2017
1 parent 0d8d917 commit 44a08b3
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -98,9 +98,9 @@ static int runElevated(File agentExe, String command, TaskListener out, File pwd
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 44a08b3

Please sign in to comment.