[infer] Fix resource leak in BlameCommand
Bug: 509385 Change-Id: Ic57fd3bf940752229e35102e7761823f7d3d8732 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
075e55fa28
commit
05e8cdf563
|
@ -248,11 +248,12 @@ private RawText getRawText(File inTree) throws IOException,
|
|||
rawText = new RawText(inTree);
|
||||
break;
|
||||
case TRUE:
|
||||
AutoLFInputStream in = new AutoLFInputStream(
|
||||
new FileInputStream(inTree), true);
|
||||
try (AutoLFInputStream in = new AutoLFInputStream(
|
||||
new FileInputStream(inTree), true)) {
|
||||
// Canonicalization should lead to same or shorter length
|
||||
// (CRLF to LF), so the file size on disk is an upper size bound
|
||||
rawText = new RawText(toByteArray(in, (int) inTree.length()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(
|
||||
|
|
Loading…
Reference in New Issue