Browse Source

[infer] Fix resource leak in ObjectChecker

Bug: 509385
Change-Id: I6b6ff5b721d959eb0708003a40c8f97d6826ac46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.6
Matthias Sohn 8 years ago
parent
commit
325cb35ccd
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java

5
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java

@ -709,11 +709,12 @@ public class ObjectChecker {
return ptr; return ptr;
} }
@SuppressWarnings("resource")
@Nullable @Nullable
private ObjectId idFor(int objType, byte[] raw) { private ObjectId idFor(int objType, byte[] raw) {
if (skipList != null) { if (skipList != null) {
return new ObjectInserter.Formatter().idFor(objType, raw); try (ObjectInserter.Formatter fmt = new ObjectInserter.Formatter()) {
return fmt.idFor(objType, raw);
}
} }
return null; return null;
} }

Loading…
Cancel
Save