From ac6242087065bf9046b99a7ed7fdaee599cba466 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Fri, 17 Feb 2023 23:27:07 +0100 Subject: [PATCH] isisd: Add free func for Sub-Sub-TLVs in general Add a function to free all the Sub-Sub-TLVs and the `isis_subsubtlvs` data structure passed as an argument. At this time, this function only frees the `isis_subsubtlvs`. It does not free any specific Sub-Sub-TLVs because no Sub-Sub-TLVs have been defined yet. This function will be extended in future commits to free specific Sub-Sub-TLVs, as they become supported. Signed-off-by: Carmine Scarpitta --- isisd/isis_tlvs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index 5441db7833..50110a4e2f 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -2006,6 +2006,14 @@ static void isis_format_subsubtlvs(struct isis_subsubtlvs *subsubtlvs, { } +static void isis_free_subsubtlvs(struct isis_subsubtlvs *subsubtlvs) +{ + if (!subsubtlvs) + return; + + XFREE(MTYPE_ISIS_SUBSUBTLV, subsubtlvs); +} + /* Functions related to subtlvs */ static struct isis_subtlvs *isis_alloc_subtlvs(enum isis_tlv_context context) -- 2.39.5