From f3482670f9e936ae8f9007d2e6678f13793331bd Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sun, 19 Jan 2014 17:50:48 +0900 Subject: [PATCH] Fix IllegalReferenceCountException which occurs when multipart data is stored in memory - Fixes #2102 --- .../handler/codec/http/multipart/AbstractMemoryHttpData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java index c3a3e0adc6..929226b8e2 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractMemoryHttpData.java @@ -206,7 +206,7 @@ public abstract class AbstractMemoryHttpData extends AbstractHttpData { if (sizeLeft < length) { sliceLength = sizeLeft; } - ByteBuf chunk = byteBuf.slice(chunkPosition, sliceLength); + ByteBuf chunk = byteBuf.slice(chunkPosition, sliceLength).retain(); chunkPosition += sliceLength; return chunk; }