From 92d537611b2cd13c51d1d117f25c63f2b4480e50 Mon Sep 17 00:00:00 2001 From: Samanvitha B Bhargav Date: Wed, 21 Sep 2022 01:45:41 -0700 Subject: [PATCH] bgpd: memory leak issue fix In ecommunity_del_val(), ecommunity was not being freed when the last value in the ecommunity was being deleted. Signed-off-by: Samanvitha B Bhargav --- bgpd/bgp_ecommunity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index f57e9ae88b..589d9af1e5 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -1383,7 +1383,7 @@ bool ecommunity_del_val(struct ecommunity *ecom, struct ecommunity_val *eval) XFREE(MTYPE_ECOMMUNITY_VAL, ecom->val); ecom->val = p; } else - ecom->val = NULL; + XFREE(MTYPE_ECOMMUNITY_VAL, ecom->val); return true; } -- 2.39.5