summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_lcommunity.c
diff options
context:
space:
mode:
authorNaveen Thanikachalam <nthanikachal@vmware.com>2020-04-07 14:03:34 +0200
committerNaveen Thanikachalam <nthanikachal@vmware.com>2020-04-09 05:27:49 +0200
commit74a630b606143b88f2d0db18c0b8c8530e4d0ae4 (patch)
treeb3f91393fbc8d3ce2f582cb2703a0352dcf309d7 /bgpd/bgp_lcommunity.c
parentMerge pull request #6167 from qlyoung/fix-cluster-list-uaf (diff)
downloadfrr-74a630b606143b88f2d0db18c0b8c8530e4d0ae4.tar.xz
frr-74a630b606143b88f2d0db18c0b8c8530e4d0ae4.zip
bgpd: Fixes for memory leaks.
This commit addresses the memory leaks when certain BGP JSON show commands are executed Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Diffstat (limited to 'bgpd/bgp_lcommunity.c')
-rw-r--r--bgpd/bgp_lcommunity.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c
index ec7d07fe7..f47ae9166 100644
--- a/bgpd/bgp_lcommunity.c
+++ b/bgpd/bgp_lcommunity.c
@@ -46,6 +46,8 @@ void lcommunity_free(struct lcommunity **lcom)
{
XFREE(MTYPE_LCOMMUNITY_VAL, (*lcom)->val);
XFREE(MTYPE_LCOMMUNITY_STR, (*lcom)->str);
+ if ((*lcom)->json)
+ json_object_free((*lcom)->json);
XFREE(MTYPE_LCOMMUNITY, *lcom);
}