[#1579] Fix resource leakage in WebSocketUtil.base64(...)
This commit is contained in:
parent
5297eba280
commit
e879848056
@ -71,7 +71,10 @@ final class WebSocketUtil {
|
||||
*/
|
||||
static String base64(byte[] data) {
|
||||
ByteBuf encodedData = Unpooled.wrappedBuffer(data);
|
||||
return Base64.encode(encodedData).toString(CharsetUtil.UTF_8);
|
||||
ByteBuf encoded = Base64.encode(encodedData);
|
||||
String encodedString = encoded.toString(CharsetUtil.UTF_8);
|
||||
encoded.release();
|
||||
return encodedString;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user