summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2016-12-30 16:48:29 -0500
committerLou Berger <lberger@labn.net>2017-01-02 15:06:46 -0500
commit7bae2fb913ed56e3e559c8fbec2be7f0f85c60c2 (patch)
tree3f8fdf88011531642b7cfbde25f4011522a7784a
parentbede77445018ed62042f677adc82654ab32ba4c9 (diff)
bgpd: fix ecommunity hash related leak
Signed-off-by: Lou Berger <lberger@labn.net>
-rw-r--r--bgpd/bgp_ecommunity.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 6c72aa36d9..65415dcee2 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -54,6 +54,13 @@ ecommunity_free (struct ecommunity **ecom)
ecom = NULL;
}
+static void
+ecommunity_hash_free (struct ecommunity *ecom)
+{
+ ecommunity_free(&ecom);
+}
+
+
/* Add a new Extended Communities value to Extended Communities
Attribute structure. When the value is already exists in the
structure, we don't add the value. Newly added value is sorted by
@@ -282,6 +289,7 @@ ecommunity_init (void)
void
ecommunity_finish (void)
{
+ hash_clean (ecomhash, (void (*)(void *))ecommunity_hash_free);
hash_free (ecomhash);
ecomhash = NULL;
}