summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2023-09-21 18:32:06 +0200
committerCarmine Scarpitta <cscarpit@cisco.com>2023-09-21 18:43:04 +0200
commit46d1028a89555a754644a8ebc0f8d2aa67299a91 (patch)
tree0d3d30b64eef6c45946f994b66934087cc1fc0e3 /isisd
parentMerge pull request #14453 from pguibert6WIND/isis_startup_crash (diff)
downloadfrr-46d1028a89555a754644a8ebc0f8d2aa67299a91.tar.xz
frr-46d1028a89555a754644a8ebc0f8d2aa67299a91.zip
isisd: Fix SRv6 memory leaks
When isis_zebra_process_srv6_locator_chunk() returns prematurely due to an error, do not forget to free memory allocated by srv6_locator_chunk_alloc(). Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_zebra.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 318934b49..8252c1ac2 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, "