[infer] Fix resource leak in ObjectChecker
Bug: 509385 Change-Id: I6b6ff5b721d959eb0708003a40c8f97d6826ac46 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
f30fe13ac9
commit
325cb35ccd
|
@ -709,11 +709,12 @@ private int scanPathSegment(byte[] raw, int ptr, int end,
|
||||||
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…
Reference in New Issue