From eedbadf606aae5cfd56fa8179bd3991cc47a7fe5 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 12 Mar 2024 13:12:48 -0400 Subject: [PATCH] eigrpd, mgmtd, ospf6d: frr_fini is last I noticed that ospf6d always had a linked list memory leak. Tracking it down shows that frr_fini() shuts down the memory system and prints out memory not cleaned up. eigrpd, mgmtd and ospf6d all called cleanup functions after frr_fini leaving memory leaked that was not really leaked. Signed-off-by: Donald Sharp --- eigrpd/eigrp_main.c | 3 ++- mgmtd/mgmt_testc.c | 4 +++- ospf6d/ospf6_main.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c index 1491c569ec..d387b9be18 100644 --- a/eigrpd/eigrp_main.c +++ b/eigrpd/eigrp_main.c @@ -94,10 +94,11 @@ static void sighup(void) static void sigint(void) { zlog_notice("Terminating on signal"); - eigrp_terminate(); keychain_terminate(); + eigrp_terminate(); + exit(0); } diff --git a/mgmtd/mgmt_testc.c b/mgmtd/mgmt_testc.c index 7e3ded8209..a33a55efca 100644 --- a/mgmtd/mgmt_testc.c +++ b/mgmtd/mgmt_testc.c @@ -133,8 +133,10 @@ static void sigusr1(void) static void quit(int exit_code) { EVENT_OFF(event_timeout); - frr_fini(); darr_free(__client_cbs.notif_xpaths); + + frr_fini(); + exit(exit_code); } diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 0e8504c529..abd4320335 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -110,9 +110,10 @@ static void __attribute__((noreturn)) ospf6_exit(int status) ospf6_master_delete(); + keychain_terminate(); + frr_fini(); - keychain_terminate(); exit(status); } -- 2.39.5