From a55df36ae4d9fdd6541987857b45a40e2ddb3a18 Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Fri, 21 Aug 2015 11:15:10 -0700 Subject: [PATCH] ce6931e0e51096c5b6f1fc23ac939fb95ee70bc1 buffer leak in EpollSocketChannelTest Motivation: ce6931e0e51096c5b6f1fc23ac939fb95ee70bc1 introduced a buffer leak in EpollSocketChannelTest. Modifications: - Fix buffer leak Result: No more buffer leak. --- .../java/io/netty/channel/epoll/EpollSocketChannelTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelTest.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelTest.java index c13ac8f7ee..b29967ae96 100644 --- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelTest.java +++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelTest.java @@ -26,6 +26,7 @@ import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; import io.netty.channel.ServerChannel; +import io.netty.util.ReferenceCountUtil; import org.junit.Assert; import org.junit.Test; @@ -182,6 +183,7 @@ public class EpollSocketChannelTest { private static class BuggyChannelHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + ReferenceCountUtil.release(msg); throw new NullPointerException("I am a bug!"); } }