[#1579] Fix resource leakage in WebSocketUtil.base64(...)

This commit is contained in:
Norman Maurer 2013-07-15 19:12:24 +02:00
parent 5297eba280
commit e879848056

View File

@ -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;
}
/**