diff --git a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java index 13ceb5aecf..6ebf88a084 100644 --- a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java @@ -567,9 +567,10 @@ public abstract class ReplayingDecoder> private ChannelBuffer cumulation(ChannelHandlerContext ctx) { ChannelBuffer buf = this.cumulation; if (buf == null) { - ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory(); - buf = new UnsafeDynamicChannelBuffer(factory); + if (cumulation == null) { + ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory(); + buf = new UnsafeDynamicChannelBuffer(factory); cumulation = buf; replayable = new ReplayingDecoderBuffer(buf); } else {