diff --git a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java index 9dd8a1a9a4..a5b0be0bdb 100644 --- a/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java +++ b/spring-web-reactive/src/main/java/org/springframework/core/codec/support/XmlEventDecoder.java @@ -143,13 +143,14 @@ public class XmlEventDecoder extends AbstractDecoder { } } } - DataBufferUtils.release(dataBuffer); return Flux.fromIterable(events); } catch (XMLStreamException ex) { return Mono.error(ex); } - + finally { + DataBufferUtils.release(dataBuffer); + } } } }