summaryrefslogtreecommitdiff
path: root/bgpd/bgp_lcommunity.c
diff options
context:
space:
mode:
authorNaveen Thanikachalam <nthanikachal@vmware.com>2020-04-07 05:03:34 -0700
committerNaveen Thanikachalam <nthanikachal@vmware.com>2020-04-08 20:27:49 -0700
commit74a630b606143b88f2d0db18c0b8c8530e4d0ae4 (patch)
treeb3f91393fbc8d3ce2f582cb2703a0352dcf309d7 /bgpd/bgp_lcommunity.c
parent7611871dfc447bc56f6b4e7c2937f0583ebf000f (diff)
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 ec7d07fe73..f47ae91663 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);
}