Fix buffer leaks in Bzip2DecoderTest

This commit is contained in:
Norman Maurer 2014-06-26 09:21:44 +02:00
parent e2452c2f34
commit 70f1ce3cdd

View File

@ -229,9 +229,11 @@ public class Bzip2DecoderTest {
ByteBuf msg; ByteBuf msg;
while ((msg = channel.readInbound()) != null) { while ((msg = channel.readInbound()) != null) {
uncompressed.writeBytes(msg); uncompressed.writeBytes(msg);
msg.release();
} }
final byte[] result = new byte[uncompressed.readableBytes()]; final byte[] result = new byte[uncompressed.readableBytes()];
uncompressed.readBytes(result); uncompressed.readBytes(result);
uncompressed.release();
assertArrayEquals(BYTES_LARGE, result); assertArrayEquals(BYTES_LARGE, result);
} }