Merge pull request #11615 from opensourcerouting/fix/memory_leak_for_community

bgpd: Fix memory leak for community stuff
This commit is contained in:
Jafar Al-Gharaibeh 2022-07-16 16:03:51 -05:00 committed by GitHub
commit 3adfa0ce55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -914,8 +914,16 @@ void community_init(void)
"BGP Community Hash"); "BGP Community Hash");
} }
static void community_hash_free(void *data)
{
struct community *com = data;
community_free(&com);
}
void community_finish(void) void community_finish(void)
{ {
hash_clean(comhash, community_hash_free);
hash_free(comhash); hash_free(comhash);
comhash = NULL; comhash = NULL;
} }