Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes d117a9502 -> 75cae0f76


Make sure stream is closed (and file unlocked) if exception is thrown


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e061ffab
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e061ffab
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e061ffab

Branch: refs/heads/3.0.x-fixes
Commit: e061ffaba9b0642536642de146e1071cfb088e47
Parents: d117a95
Author: Daniel Kulp <[email protected]>
Authored: Fri Oct 9 10:50:32 2015 -0400
Committer: Daniel Kulp <[email protected]>
Committed: Mon Oct 12 15:28:50 2015 -0400

----------------------------------------------------------------------
 core/src/main/java/org/apache/cxf/io/CachedWriter.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e061ffab/core/src/main/java/org/apache/cxf/io/CachedWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/io/CachedWriter.java 
b/core/src/main/java/org/apache/cxf/io/CachedWriter.java
index 3444c05..25e35b7 100644
--- a/core/src/main/java/org/apache/cxf/io/CachedWriter.java
+++ b/core/src/main/java/org/apache/cxf/io/CachedWriter.java
@@ -628,6 +628,7 @@ public class CachedWriter extends Writer {
                     ciphers = new CipherPair(cipherTransformation);
                 }
             } catch (GeneralSecurityException e) {
+                out.close();
                 throw new IOException(e.getMessage(), e);
             }
             out = new CipherOutputStream(out, ciphers.getEncryptor()) {

Reply via email to