Always ensure we don't pass a heap ByteBuf to the natives.

This commit is contained in:
Andrew Steinborn
2018-12-30 04:53:47 -05:00
parent 1c50922cba
commit 095a478440
5 changed files with 37 additions and 20 deletions

View File

@@ -25,7 +25,7 @@ public class MoreByteBufUtils {
return buf.retain();
}
// It's not, so we must make a memory copy.
// It's not, so we must make a direct copy.
ByteBuf newBuf = alloc.directBuffer();
newBuf.writeBytes(buf);
return newBuf;