Skip to content

Commit

Permalink
Release FileUpload, not the wrapped buffer, in NettyCompletedFileUplo…
Browse files Browse the repository at this point in the history
…ad (#6759)

When `controlRelease` is set, `NettyCompletedFileUpload` will `retain()` the `FileUpload` instance, however before this patch, it would `release` the `FileUpload.getByteBuf()`, not the `FileUpload` itself.

This bug can be reproduced using `UploadSpec#test upload CompletedFileUpload object`, but unfortunately does not yield a test failure, only a log message.

Fixes #6710
  • Loading branch information
yawkat committed Jan 21, 2022
1 parent 944db35 commit d67f4f0
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -106,7 +106,7 @@ public byte[] getBytes() throws IOException {
return ByteBufUtil.getBytes(byteBuf);
} finally {
if (controlRelease) {
byteBuf.release();
fileUpload.release();
}
}
}
Expand All @@ -130,7 +130,7 @@ public ByteBuffer getByteBuffer() throws IOException {
return byteBuf.nioBuffer();
} finally {
if (controlRelease) {
byteBuf.release();
fileUpload.release();
}
}
}
Expand Down

0 comments on commit d67f4f0

Please sign in to comment.