diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-10-26 22:31:50 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-10-26 23:10:03 +0200 |
commit | 999106bb848bafc47d956aba933fac7cda636257 (patch) | |
tree | bfb31ddf95c8b1601b06b5bd7617cd3f55ad63c5 /org.eclipse.jgit.lfs | |
parent | 4b7747ccff99be241a1256319d1c825cbe264e07 (diff) | |
download | jgit-999106bb848bafc47d956aba933fac7cda636257.tar.gz jgit-999106bb848bafc47d956aba933fac7cda636257.zip |
Fix temporary file leak in CleanFilter
The CleanFilter leaked temporary files when a media file already existed
before running clean filter.
Change-Id: Ie20fce3f40d34095ce58e596d25d8d64fe0cde99
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java index f7ad689744..c8a5918aa7 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java @@ -157,6 +157,8 @@ public class CleanFilter extends FilterCommand { long fsSize = Files.size(mediaFile); if (fsSize != size) { throw new CorruptMediaFile(mediaFile, size, fsSize); + } else { + FileUtils.delete(tmpFile.toFile()); } } else { FileUtils.mkdirs(mediaFile.getParent().toFile(), true); |