Skip to content

Commit

Permalink
[apache#1355] fix(client): Netty client will leak when decoding respo…
Browse files Browse the repository at this point in the history
…nses
  • Loading branch information
rickyma committed Jan 16, 2024
1 parent 2b77d46 commit 55bcb03
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ public void channelRead(ChannelHandlerContext ctx, Object data) {
}

static boolean shouldRelease(Message msg) {
if (msg == null || msg.body() == null) {
if (msg == null || msg.body() == null || msg.body().byteBuf() == null) {
return true;
}
boolean shouldRelease =
msg.body().byteBuf() != null && msg.body().byteBuf().readableBytes() == 0;
return shouldRelease;
return msg.body().byteBuf().readableBytes() == 0;
}

private void clear() {
Expand Down

0 comments on commit 55bcb03

Please sign in to comment.