Ensure BufUtil.release() is called even if writeBytes() fails in writeAndRelease()
This commit is contained in:
parent
015e60b00f
commit
03955428bc
@ -167,7 +167,10 @@ final class OutputMessageBuf extends DefaultMessageBuf<Object> {
|
||||
}
|
||||
|
||||
private static void writeAndRelease(ByteBuf dst, ByteBuf src) {
|
||||
dst.writeBytes(src, src.readerIndex(), src.readableBytes());
|
||||
BufUtil.release(src);
|
||||
try {
|
||||
dst.writeBytes(src, src.readerIndex(), src.readableBytes());
|
||||
} finally {
|
||||
BufUtil.release(src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user