readBytes() returns a ByteBuf, which needs to be be freed eventually
through ByteBuf.release() -- which we are not doing. Use readSlice()
instead.
JIRA: BGPCEP-973
Change-Id: Ide5af583cb33823a941093e6f9e7d5b61b4d2f3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
2350174ac2f6127e814307ff9940da0a2f904d13)
}
mldpP2mpLsp.setAddressFamily(addressFamily);
final short rootNodeLength = buffer.readUnsignedByte();
- mldpP2mpLsp.setRootNodeAddress(parseIpAddress(rootNodeLength, buffer.readBytes(rootNodeLength)));
+ mldpP2mpLsp.setRootNodeAddress(parseIpAddress(rootNodeLength, buffer.readSlice(rootNodeLength)));
final int opaqueValueLength = buffer.readUnsignedShort();
- mldpP2mpLsp.setOpaqueValue(OpaqueUtil.parseOpaqueList(buffer.readBytes(opaqueValueLength)));
+ mldpP2mpLsp.setOpaqueValue(OpaqueUtil.parseOpaqueList(buffer.readSlice(opaqueValueLength)));
return new MldpP2mpLspBuilder().setMldpP2mpLsp(mldpP2mpLsp.build()).build();
}
}
public LeafADCase parseMvpn(final ByteBuf buffer) {
final NlriType type = NlriType.forValue(buffer.readUnsignedByte());
final short length = buffer.readUnsignedByte();
- final MvpnChoice key = SimpleMvpnNlriRegistry.getInstance().parseMvpn(type, buffer.readBytes(length));
+ final MvpnChoice key = SimpleMvpnNlriRegistry.getInstance().parseMvpn(type, buffer.readSlice(length));
final LeafADRouteKey routeKey;
if (type == NlriType.InterAsIPmsiAD) {
routeKey = new InterAsIPmsiADCaseBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang