Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2018-10-11 12:42:28 +0000
committerDavid Pursehouse2018-10-13 23:46:38 +0000
commit89388d67f820b379ce2fa58539959f5f61a44fde (patch)
treebdcc43d17058783d32a4eece24944c3d0f89d1f2 /org.eclipse.jgit.lfs.server
parent33744a2dfe4fd0dd5fd55d56d8bc0520788b855d (diff)
downloadjgit-89388d67f820b379ce2fa58539959f5f61a44fde.tar.gz
jgit-89388d67f820b379ce2fa58539959f5f61a44fde.tar.xz
jgit-89388d67f820b379ce2fa58539959f5f61a44fde.zip
Fix file handle leak in ObjectDownloadListener.onWritePossible
5c134f4d removed closing the input stream when we reached end of the stream. This caused file handle leaks. Bug: 540049 Change-Id: I48082b537077c7471fc160f59aa04deb99687d9b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server')
-rw-r--r--org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
index 2dc9493f3f..a76f7ef0d8 100644
--- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
+++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java
@@ -122,7 +122,7 @@ public class ObjectDownloadListener implements WriteListener {
} else {
buffer.flip();
}
- } catch(Throwable t) {
+ } catch (Throwable t) {
LOG.log(Level.SEVERE, t.getMessage(), t);
buffer = null;
} finally {
@@ -130,6 +130,11 @@ public class ObjectDownloadListener implements WriteListener {
outChannel.write(buffer);
} else {
try {
+ in.close();
+ } catch (IOException e) {
+ LOG.log(Level.SEVERE, e.getMessage(), e);
+ }
+ try {
out.close();
} finally {
context.complete();

Back to the top