Fix potential buffer leak in AbstractBinaryMemcacheDecoder

If a connection is closed unexpectedly while
AbstractBinaryMemcacheDecoder decodes a message, the half-constructed
message's content might not be released.
This commit is contained in:
Trustin Lee 2014-06-24 16:22:53 +09:00
parent cde319dabd
commit 33b9bc02ed

View File

@ -200,8 +200,8 @@ public abstract class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMess
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
if (currentMessage != null && currentMessage.extras() != null) {
currentMessage.extras().release();
if (currentMessage != null) {
currentMessage.release();
}
resetDecoder();