From 9b67b5147486be9b754c9c9a6c82bcac49505eb1 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 29 Jun 2017 09:45:18 -0400 Subject: [PATCH] zebra: Fix some memory leaks on shutdown Signed-off-by: Donald Sharp --- zebra/zebra_mpls.c | 8 +++++--- zebra/zebra_vxlan.c | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index e44e5d2e6b..b1edb7d960 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -1321,9 +1321,9 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty) default: break; } - vty_out(vty, "%s", - CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED) ? " (installed)" - : ""); + vty_out(vty, "%s", CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED) + ? " (installed)" + : ""); vty_out(vty, "\n"); } @@ -2807,6 +2807,8 @@ void zebra_mpls_close_tables(struct zebra_vrf *zvrf) hash_free(zvrf->lsp_table); hash_clean(zvrf->slsp_table, NULL); hash_free(zvrf->slsp_table); + route_table_finish(zvrf->fec_table[AFI_IP]); + route_table_finish(zvrf->fec_table[AFI_IP6]); } /* diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index ee9a88c66c..dc8e6e9c0e 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3736,4 +3736,5 @@ void zebra_vxlan_init_tables(struct zebra_vrf *zvrf) void zebra_vxlan_close_tables(struct zebra_vrf *zvrf) { hash_iterate(zvrf->vni_table, zvni_cleanup_all, zvrf); + hash_free(zvrf->vni_table); } -- 2.39.5