HDFS-11253. FileInputStream leak on failure path in BlockSender. Contributed by Arpit Agarwal

This commit is contained in:
Mingliang Liu 2016-12-15 15:39:15 -08:00 committed by Arpit Agarwal
parent 48fb796fcb
commit ce5ad0e88f
1 changed files with 2 additions and 0 deletions

View File

@ -414,6 +414,8 @@ class BlockSender implements java.io.Closeable {
ris = new ReplicaInputStreams(blockIn, checksumIn, volumeRef);
} catch (IOException ioe) {
IOUtils.closeStream(this);
org.apache.commons.io.IOUtils.closeQuietly(blockIn);
org.apache.commons.io.IOUtils.closeQuietly(checksumIn);
throw ioe;
}
}