[infer] Fix resource leak in DirCache
Bug: 509385 Change-Id: I5f914c910ef3a7583594fb31c7757d3dddf6a05e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
aa199ff648
commit
1779fb4a57
|
@ -634,9 +634,9 @@ public boolean lock() throws IOException {
|
|||
public void write() throws IOException {
|
||||
final LockFile tmp = myLock;
|
||||
requireLocked(tmp);
|
||||
try {
|
||||
writeTo(liveFile.getParentFile(),
|
||||
new BufferedOutputStream(tmp.getOutputStream()));
|
||||
try (OutputStream o = tmp.getOutputStream();
|
||||
OutputStream bo = new BufferedOutputStream(o)) {
|
||||
writeTo(liveFile.getParentFile(), bo);
|
||||
} catch (IOException err) {
|
||||
tmp.unlock();
|
||||
throw err;
|
||||
|
|
Loading…
Reference in New Issue