Please sign in to comment.
Avoid potential memory leak in `ByteToMessageDecoder` (#937)
Motivation: `ByteToMessageDecoder` does not release the received `ByteBuf` message when it copies data to the cumulation buffer. It's not an issue at this moment, because we always see unpooled buffers here (because `CopyByteBufHandler` copies data to unpooled memory), but we should release any way to prevent memory leaks if this assumption changes. Modifications: - Add `try-finally` block to release inbound `ByteBuf` after we copied it to the cumulation buffer; Result: No memory leaks in `ByteToMessageDecoder`.
- Loading branch information
Showing with 15 additions and 10 deletions.