summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_lcommunity.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-01-25 14:26:21 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-25 14:26:21 +0100
commit47350fd9f4b56b3e8200ea6c8c9c8b07d0fbb9c6 (patch)
tree8de7eb995c192d9be772fb2b4491d97b9a200b88 /bgpd/bgp_lcommunity.c
parentbgpd: Fix cli for large-communities (diff)
downloadfrr-47350fd9f4b56b3e8200ea6c8c9c8b07d0fbb9c6.tar.xz
frr-47350fd9f4b56b3e8200ea6c8c9c8b07d0fbb9c6.zip
bgpd: Add ability to clean lcommunity hash
Ensure that we don't leak any memory on shutdown. Since the bgp_lcommunity.c file mirrors bgp_ecommunity.c Add the same code for shutdown that ecommunity has. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_lcommunity.c')
-rw-r--r--bgpd/bgp_lcommunity.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c
index a4b6d96ed..dc98809f6 100644
--- a/bgpd/bgp_lcommunity.c
+++ b/bgpd/bgp_lcommunity.c
@@ -54,6 +54,12 @@ lcommunity_free (struct lcommunity **lcom)
lcom = NULL;
}
+static void
+lcommunity_hash_free (struct lcommunity *lcom)
+{
+ lcommunity_free (&lcom);
+}
+
/* Add a new Large Communities value to Large Communities
Attribute structure. When the value is already exists in the
structure, we don't add the value. Newly added value is sorted by
@@ -287,6 +293,7 @@ lcommunity_init (void)
void
lcommunity_finish (void)
{
+ hash_clean (lcomhash, (void (*)(void *))lcommunity_hash_free);
hash_free (lcomhash);
lcomhash = NULL;
}