Fix resource-leak which was reported as a result of commit 69070c37ba
This commit is contained in:
parent
fb434de598
commit
3046e9b78b
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.embedded.EmbeddedChannel;
|
||||
import io.netty.handler.codec.TooLongFrameException;
|
||||
@ -540,7 +541,16 @@ public class HttpResponseDecoderTest {
|
||||
|
||||
assertThat(ch.finish(), is(true));
|
||||
|
||||
assertEquals(ch.readInbound(), Unpooled.wrappedBuffer(otherData));
|
||||
ByteBuf expected = Unpooled.wrappedBuffer(otherData);
|
||||
ByteBuf buffer = ch.readInbound();
|
||||
try {
|
||||
assertEquals(expected, buffer);
|
||||
} finally {
|
||||
expected.release();
|
||||
if (buffer != null) {
|
||||
buffer.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user