diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/InternalAttribute.java b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/InternalAttribute.java index 2637ff57f4..275b46aeea 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/InternalAttribute.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/InternalAttribute.java @@ -31,7 +31,8 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf private final List value = new ArrayList(); private final Charset charset; private int size; - public InternalAttribute(Charset charset) { + + InternalAttribute(Charset charset) { this.charset = charset; } @@ -66,6 +67,7 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf ByteBuf old = this.value.set(rank, buf); if (old != null) { size -= old.readableBytes(); + old.release(); } size += buf.readableBytes(); }