Fix memory leaks in ProtobufDecoder
Issue: SPR-17418
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -66,9 +66,12 @@ public abstract class AbstractDataBufferAllocatingTestCase {
|
||||
}
|
||||
|
||||
protected DataBuffer stringBuffer(String value) {
|
||||
byte[] bytes = value.getBytes(StandardCharsets.UTF_8);
|
||||
DataBuffer buffer = this.bufferFactory.allocateBuffer(bytes.length);
|
||||
buffer.write(bytes);
|
||||
return byteBuffer(value.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
protected DataBuffer byteBuffer(byte[] value) {
|
||||
DataBuffer buffer = this.bufferFactory.allocateBuffer(value.length);
|
||||
buffer.write(value);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user