summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2021-09-03 13:06:15 +0200
committerMobashshera Rasool <mrasool@vmware.com>2021-09-03 13:06:15 +0200
commit6f3e19b736b5e7cfaf6ef5514d74358a8de182a3 (patch)
treed77594d614a85f0dcdde43c0618ec132e482eca0 /ospfd
parentMerge pull request #9538 from donaldsharp/bgp_view_not_working (diff)
downloadfrr-6f3e19b736b5e7cfaf6ef5514d74358a8de182a3.tar.xz
frr-6f3e19b736b5e7cfaf6ef5514d74358a8de182a3.zip
ospfd: Memory Leak seen at show_ip_ospf_neighbor_all_common.
Problem Statement: ================== Memory Leak seen at show_ip_ospf_neighbor_all_common (ospf_vty.c:4635) RCA: ================= In function show_ip_ospf_neighbor_all_common, one child json object is not added to the parent child object when there is no nbma neighbor. Hence the memory leak. Fix: ================= Add the child object to the parent json object. Fixes: #9548 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_vty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 515ec28b1..1d4aa6535 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -4682,7 +4682,6 @@ static int show_ip_ospf_neighbor_all_common(struct vty *vty, struct ospf *ospf,
json_vrf = json_object_new_object();
else
json_vrf = json;
- json_neighbor_sub = json_object_new_object();
}
ospf_show_vrf_name(ospf, vty, json_vrf, use_vrf);
@@ -4708,6 +4707,8 @@ static int show_ip_ospf_neighbor_all_common(struct vty *vty, struct ospf *ospf,
if (nbr_nbma->nbr == NULL
|| nbr_nbma->nbr->state == NSM_Down) {
if (use_json) {
+ json_neighbor_sub =
+ json_object_new_object();
json_object_int_add(json_neighbor_sub,
"nbrNbmaPriority",
nbr_nbma->priority);