From 2389c71e81dbbfab3352e059bdf52d4de73fb0f4 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sun, 19 Jan 2014 16:53:43 +0900 Subject: [PATCH] Fix resource leak in InternalAttribute.setValue() --- .../netty/handler/codec/http/multipart/InternalAttribute.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); }