diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2022-07-18 12:42:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-18 12:42:36 -0500 |
| commit | 13d72310394696c0bdbea47772764db8837e67f1 (patch) | |
| tree | 2fcf0f08b298012d9e106485f2b874fbd2c41404 /zebra/zebra_mpls.c | |
| parent | 5f5b29862f4cd82c035badb7aefc55e08c38910b (diff) | |
| parent | 912b6a5b5c4351b5386dc267db46797f3ffc33d4 (diff) | |
Merge pull request #11635 from opensourcerouting/fix/memory_leak_for_mpls
zebra: Cleanup the memory from the hash for MPLS stuff
Diffstat (limited to 'zebra/zebra_mpls.c')
| -rw-r--r-- | zebra/zebra_mpls.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 772e30833c..8fe5dd9d27 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -4005,6 +4005,13 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto) } } +static void lsp_table_free(void *p) +{ + struct zebra_lsp *lsp = p; + + XFREE(MTYPE_LSP, lsp); +} + /* * Called upon process exiting, need to delete LSP forwarding * entries from the kernel. @@ -4013,9 +4020,9 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto) void zebra_mpls_close_tables(struct zebra_vrf *zvrf) { hash_iterate(zvrf->lsp_table, lsp_uninstall_from_kernel, NULL); - hash_clean(zvrf->lsp_table, NULL); + hash_clean(zvrf->lsp_table, lsp_table_free); hash_free(zvrf->lsp_table); - hash_clean(zvrf->slsp_table, NULL); + hash_clean(zvrf->slsp_table, lsp_table_free); hash_free(zvrf->slsp_table); route_table_finish(zvrf->fec_table[AFI_IP]); route_table_finish(zvrf->fec_table[AFI_IP6]); |
