]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix ecommunity hash related leak
authorLou Berger <lberger@labn.net>
Fri, 30 Dec 2016 21:48:29 +0000 (16:48 -0500)
committerLou Berger <lberger@labn.net>
Mon, 2 Jan 2017 20:06:46 +0000 (15:06 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_ecommunity.c

index 6c72aa36d9fa7d603db65aca3f5c9941756fa385..65415dcee2431dea0a8650018eef7f648bead9b6 100644 (file)
@@ -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;
 }