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
This commit is contained in:
Donatas Abraitis 2023-09-24 20:47:15 +03:00 committed by GitHub
commit 1c829fac8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, "