summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-07-16 20:56:38 -0400
committerGitHub <noreply@github.com>2022-07-16 20:56:38 -0400
commita6d36e5541317451d9ad9e5ef30c0fc299e6afe5 (patch)
tree62d9e5e482ca28ea46c3e9129fb843ce681386af
parentd2136e2449ff7a0c836e496a1bd27321c790da26 (diff)
parentfd34cf8f557a767cfadf2924335caff0c6ccfb7a (diff)
Merge pull request #11620 from FRRouting/mergify/bp/stable/8.3/pr-11615
bgpd: Fix memory leak for community stuff (backport #11615)
-rw-r--r--bgpd/bgp_community.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index 78cf9ea76c..9f6f337c88 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -914,8 +914,16 @@ void community_init(void)
"BGP Community Hash");
}
+static void community_hash_free(void *data)
+{
+ struct community *com = data;
+
+ community_free(&com);
+}
+
void community_finish(void)
{
+ hash_clean(comhash, community_hash_free);
hash_free(comhash);
comhash = NULL;
}