netty5/buffer/src
Nick Hill a71e33ae35 Fix possible ByteBuf leak when CompositeByteBuf is resized (#8946)
Motivation:

The special case fixed in #8497 also requires that we keep a derived slice when trimming components in place, as done by the capacity(int) and discardReadBytes() methods.

Modifications:

Ensure that we keep a ref to trimmed components' original retained slice in capacity(int) and discardReadBytes() methods, so that it is released properly when the they are later freed. Add unit test which fails prior to the fix.

Result:

Edge case leak is eliminated.
2019-03-22 11:18:28 +01:00
..
main/java/io/netty/buffer Fix possible ByteBuf leak when CompositeByteBuf is resized (#8946) 2019-03-22 11:18:28 +01:00
test/java/io/netty/buffer Fix possible ByteBuf leak when CompositeByteBuf is resized (#8946) 2019-03-22 11:18:28 +01:00