]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd/ospfd: fix json leaks and blank output 856/head
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 26 Jul 2017 15:27:37 +0000 (12:27 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 26 Jul 2017 15:28:56 +0000 (12:28 -0300)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/bgp_evpn_vty.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/bgp_vpn.c
ospfd/ospf_vty.c

index 4b39ee86270da388dad2c191b4af2bcf01d9a3ca..1225354c0a024ac2255ecadcbc3370a4fbfde579 100644 (file)
@@ -347,6 +347,8 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
        if (bgp == NULL) {
                if (!use_json)
                        vty_out(vty, "No BGP process is configured\n");
+               else
+                       vty_out(vty, "{}\n");
                return CMD_WARNING;
        }
 
index 5d2966d1ad5d525978e6628506d9e4f5de6616f4..baf081c815f73b691563fe7ef69625c86344aa0e 100644 (file)
@@ -374,6 +374,8 @@ int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
        if (bgp == NULL) {
                if (!use_json)
                        vty_out(vty, "No BGP process is configured\n");
+               else
+                       vty_out(vty, "{}\n");
                return CMD_WARNING;
        }
 
index 7cdc839618aaed27fd1c497ab06274fceb6033ed..b554aeb32b5c2b83d76d141c6ba189946629d57f 100644 (file)
@@ -8257,6 +8257,8 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
        if (bgp == NULL) {
                if (!use_json)
                        vty_out(vty, "No BGP process is configured\n");
+               else
+                       vty_out(vty, "{}\n");
                return CMD_WARNING;
        }
 
@@ -8622,6 +8624,8 @@ static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str,
                if (!bgp) {
                        if (!use_json)
                                vty_out(vty, "No BGP process is configured\n");
+                       else
+                               vty_out(vty, "{}\n");
                        return CMD_WARNING;
                }
        }
index ca98ff0668a58c869c2a12256632da956496f4f7..4661e195a207c7e0d5a1d67245fb19034172c380 100644 (file)
@@ -51,6 +51,8 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
        if (bgp == NULL) {
                if (!use_json)
                        vty_out(vty, "No BGP process is configured\n");
+               else
+                       vty_out(vty, "{}\n");
                return CMD_WARNING;
        }
 
index 55d6c27e8c2d52c429d37dc299eaa92e109c8e66..a8bfb669af423e3a4a4da2d912fd018fb456375a 100644 (file)
@@ -4402,6 +4402,10 @@ static int show_ip_ospf_neighbor_id_common(struct vty *vty, struct ospf *ospf,
        if (!ret) {
                if (!use_json)
                        vty_out(vty, "Please specify Neighbor ID by A.B.C.D\n");
+               else {
+                       vty_out(vty, "{}\n");
+                       json_object_free(json);
+               }
                return CMD_WARNING;
        }
 
@@ -4682,6 +4686,10 @@ static int show_ip_ospf_neighbor_int_detail_common(struct vty *vty,
        if (!ifp) {
                if (!use_json)
                        vty_out(vty, "No such interface.\n");
+               else {
+                       vty_out(vty, "{}\n");
+                       json_object_free(json);
+               }
                return CMD_WARNING;
        }