diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-07-16 08:13:21 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-07-16 08:13:21 -0400 |
| commit | 892c2c4468befae94e602b6f2c7605f028e70d7a (patch) | |
| tree | b587ff83ed1d7a40cf7b4ab12f8009fdb0d152a0 | |
| parent | 249df50a203faecf099faaeb3f41a4beb5029589 (diff) | |
pimd: Cleanup some small memory leaks on exit
We were not properly cleaning up some memory in the pim mlag
subsystem. Clean it up on exit.
Signed-off-by: Donald Sharp <sharpc@cumulusnetworks.com>
| -rw-r--r-- | pimd/pim_mlag.c | 8 | ||||
| -rw-r--r-- | pimd/pim_mlag.h | 1 | ||||
| -rw-r--r-- | pimd/pimd.c | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c index 305dd5cf2c..2dfc0af1de 100644 --- a/pimd/pim_mlag.c +++ b/pimd/pim_mlag.c @@ -1082,6 +1082,14 @@ void pim_instance_mlag_terminate(struct pim_instance *pim) pim->inst_mlag_intf_cnt = 0; } +void pim_mlag_terminate(void) +{ + stream_free(router->mlag_stream); + router->mlag_stream = NULL; + stream_fifo_free(router->mlag_fifo); + router->mlag_fifo = NULL; +} + void pim_mlag_init(void) { pim_mlag_param_reset(); diff --git a/pimd/pim_mlag.h b/pimd/pim_mlag.h index eb316695f7..b044c31c44 100644 --- a/pimd/pim_mlag.h +++ b/pimd/pim_mlag.h @@ -28,6 +28,7 @@ #include "pim_iface.h" extern void pim_mlag_init(void); +extern void pim_mlag_terminate(void); extern void pim_instance_mlag_init(struct pim_instance *pim); extern void pim_instance_mlag_terminate(struct pim_instance *pim); extern void pim_if_configure_mlag_dualactive(struct pim_interface *pim_ifp); diff --git a/pimd/pimd.c b/pimd/pimd.c index 5ccbac32f2..6c354a3cc8 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -42,6 +42,7 @@ #include "pim_vxlan.h" #include "pim_zlookup.h" #include "pim_zebra.h" +#include "pim_mlag.h" const char *const PIM_ALL_SYSTEMS = MCAST_ALL_SYSTEMS; const char *const PIM_ALL_ROUTERS = MCAST_ALL_ROUTERS; @@ -109,6 +110,7 @@ void pim_router_init(void) void pim_router_terminate(void) { + pim_mlag_terminate(); XFREE(MTYPE_ROUTER, router); } |
