Fix potential ByteBuf leaks in bgp-l3vpn 50/96950/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Jul 2021 15:35:32 +0000 (17:35 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Jul 2021 15:36:50 +0000 (17:36 +0200)
commitfed701f05399b8b7c9bd4014f97d2c8a75cfc9ef
tree5e57add1d31bd6bd11236b1fbf13c098b3b54f95
parent8c668767ef84c922aaedf6f991b7e7ff045c5e2a
Fix potential ByteBuf leaks in bgp-l3vpn

We are using ByteBuf.readBytes() to skip over some content and also
to frame it for parsing. Use ByteBuf.skipBytes() in the case of former
and ByteBuf.readSlice() in case of latter. This speeds things up and
plugs a potential refcount problem.

JIRA: BGPCEP-973
Change-Id: Ib9bf406a5e9de9b5e122c3fb3323a4b772a1a798
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/AbstractVpnNextHopParserSerializer.java