diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-11-11 22:58:16 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-13 09:16:45 -0500 | 
| commit | b8fdedc6b8ca7b8a75805b78aa6e7b48714ab3ec (patch) | |
| tree | 824b5f05715daaaaf20a8572c97fb497970aa6e7 /ospf6d | |
| parent | d2aafaf5b68372b3520ee8406a52125119dc32db (diff) | |
ospf6d: Cleanup memory on shutdown
some list data structures were never freed
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ospf6d')
| -rw-r--r-- | ospf6d/ospf6_main.c | 1 | ||||
| -rw-r--r-- | ospf6d/ospf6_top.c | 13 | ||||
| -rw-r--r-- | ospf6d/ospf6_top.h | 2 | 
3 files changed, 16 insertions, 0 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 932304578a..2a189f1418 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -103,6 +103,7 @@ static void __attribute__((noreturn)) ospf6_exit(int status)  		zclient_free(zclient);  	} +	ospf6_master_delete();  	frr_fini();  	exit(status);  } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index aa0625814c..ef312cbe3a 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -486,6 +486,7 @@ void ospf6_delete(struct ospf6 *o)  	struct ospf6_area *oa;  	struct vrf *vrf;  	struct ospf6_external_aggr_rt *aggr; +	uint32_t i;  	QOBJ_UNREG(o); @@ -532,6 +533,13 @@ void ospf6_delete(struct ospf6 *o)  		}  	route_table_finish(o->rt_aggr_tbl); +	for (i = 0; i <= ZEBRA_ROUTE_MAX; i++) { +		if (!o->redist[i]) +			continue; + +		list_delete(&o->redist[i]); +	} +  	XFREE(MTYPE_OSPF6_TOP, o->name);  	XFREE(MTYPE_OSPF6_TOP, o);  } @@ -576,6 +584,11 @@ void ospf6_master_init(struct event_loop *master)  	om6->master = master;  } +void ospf6_master_delete(void) +{ +	list_delete(&om6->ospf6); +} +  static void ospf6_maxage_remover(struct event *thread)  {  	struct ospf6 *o = (struct ospf6 *)EVENT_ARG(thread); diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h index a38dad8fce..8288413c10 100644 --- a/ospf6d/ospf6_top.h +++ b/ospf6d/ospf6_top.h @@ -236,6 +236,8 @@ extern struct ospf6_master *om6;  /* prototypes */  extern void ospf6_master_init(struct event_loop *master); +extern void ospf6_master_delete(void); +  extern void install_element_ospf6_clear_process(void);  extern void ospf6_top_init(void);  extern void ospf6_delete(struct ospf6 *o);  | 
