mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-30 05:43:00 -08:00
Close stream properly.
This commit is contained in:
1 parent
23c829ec5b
commit
b77d2b93eb
1 file changed
+2
-6
@@ -92,7 +92,7 @@ public class PwDbV4Output extends PwDbOutput {
|
||||
OutputStream compressed;
|
||||
try {
|
||||
cos.write(header.streamStartBytes);
|
||||
|
||||
|
||||
HashedBlockOutputStream hashed = new HashedBlockOutputStream(cos);
|
||||
|
||||
if ( mPM.compressionAlgorithm == PwCompressionAlgorithm.Gzip ) {
|
||||
@@ -100,13 +100,9 @@ public class PwDbV4Output extends PwDbOutput {
|
||||
} else {
|
||||
compressed = hashed;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new PwDbOutputException("Failed to set up output stream.");
|
||||
}
|
||||
|
||||
try {
|
||||
outputDatabase(compressed);
|
||||
compressed.close();
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new PwDbOutputException(e);
|
||||
} catch (IllegalStateException e) {
|
||||
|
||||
Reference in new issue
Block a user