Skip to content

Commit

Permalink
Merge pull request #14467 from cscarpitta/bugfix/fix-srv6-isis-memleaks
Browse files Browse the repository at this point in the history
isisd: Fix memory leaks when IS-IS fails to process an SRv6 locator chunk
  • Loading branch information
ton31337 authored Sep 24, 2023
2 parents 56d8305 + 46d1028 commit 1c829fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions isisd/isis_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down

0 comments on commit 1c829fa

Please sign in to comment.