Browse Source

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>
stable-4.6
Matthias Sohn 8 years ago
parent
commit
999106bb84
  1. 2
      org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java

2
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); long fsSize = Files.size(mediaFile);
if (fsSize != size) { if (fsSize != size) {
throw new CorruptMediaFile(mediaFile, size, fsSize); throw new CorruptMediaFile(mediaFile, size, fsSize);
} else {
FileUtils.delete(tmpFile.toFile());
} }
} else { } else {
FileUtils.mkdirs(mediaFile.getParent().toFile(), true); FileUtils.mkdirs(mediaFile.getParent().toFile(), true);

Loading…
Cancel
Save