This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 0f25f2f  [CXF-8118]CXF LoggingInInterceptor: CachedWriter leaks
0f25f2f is described below

commit 0f25f2fd12286f1410e917d1a6c750aea065b165
Author: Freeman Fang <freeman.f...@gmail.com>
AuthorDate: Tue Sep 17 16:30:37 2019 -0400

    [CXF-8118]CXF LoggingInInterceptor: CachedWriter leaks
---
 core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java  | 1 +
 .../src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java   | 1 +
 2 files changed, 2 insertions(+)

diff --git 
a/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java 
b/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
index c7b24cc..d3f9be2 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java
@@ -183,6 +183,7 @@ public class LoggingInInterceptor extends 
AbstractLoggingInterceptor {
                 buffer.getMessage().append("(message truncated to " + limit + 
" bytes)\n");
             }
             writer.writeCacheTo(buffer.getPayload(), limit);
+            writer.close();
         } catch (Exception e) {
             throw new Fault(e);
         }
diff --git 
a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
 
b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
index 355e300..76ea59e 100644
--- 
a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
+++ 
b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
@@ -109,6 +109,7 @@ public class LoggingInInterceptor extends 
AbstractLoggingInterceptor {
         boolean isTruncated = writer.size() > limit && limit != -1;
         StringBuilder payload = new StringBuilder();
         writer.writeCacheTo(payload, limit);
+        writer.close();
         event.setPayload(payload.toString());
         event.setTruncated(isTruncated);
         event.setFullContentFile(writer.getTempFile());

Reply via email to