diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-09-24 20:47:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-24 20:47:15 +0300 |
| commit | 1c829fac8e034e9fc7f3ce778b853c9e62c825aa (patch) | |
| tree | a47f138da96ec1b65b9644489c5b0c127af12663 | |
| parent | 56d83054814e1c5bf69d507a048a2196a956f916 (diff) | |
| parent | 46d1028a89555a754644a8ebc0f8d2aa67299a91 (diff) | |
Merge pull request #14467 from cscarpitta/bugfix/fix-srv6-isis-memleaks
isisd: Fix memory leaks when IS-IS fails to process an SRv6 locator chunk
| -rw-r--r-- | isisd/isis_zebra.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 318934b491..8252c1ac25 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -1136,13 +1136,17 @@ static int isis_zebra_process_srv6_locator_chunk(ZAPI_CALLBACK_ARGS) enum srv6_endpoint_behavior_codepoint behavior; bool allocated = false; - if (!isis) + if (!isis) { + srv6_locator_chunk_free(&chunk); return -1; + } /* Decode the received zebra message */ s = zclient->ibuf; - if (zapi_srv6_locator_chunk_decode(s, chunk) < 0) + if (zapi_srv6_locator_chunk_decode(s, chunk) < 0) { + srv6_locator_chunk_free(&chunk); return -1; + } sr_debug( "Received SRv6 locator chunk from zebra: name %s, " |
