diff --git a/scripts/analysis/findbugs-results.txt b/scripts/analysis/findbugs-results.txt index 6a5426c9b3..0642336574 100644 --- a/scripts/analysis/findbugs-results.txt +++ b/scripts/analysis/findbugs-results.txt @@ -1 +1 @@ -474 \ No newline at end of file +473 \ No newline at end of file diff --git a/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java b/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java index fd0bc756bd..859c4acad3 100644 --- a/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java +++ b/src/main/java/com/owncloud/android/operations/DownloadFileOperation.java @@ -203,8 +203,9 @@ public class DownloadFileOperation extends RemoteOperation { try { byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag); - FileOutputStream fileOutputStream = new FileOutputStream(tmpFile); - fileOutputStream.write(decryptedBytes); + try (FileOutputStream fileOutputStream = new FileOutputStream(tmpFile)) { + fileOutputStream.write(decryptedBytes); + } } catch (Exception e) { return new RemoteOperationResult(e); }