bgpd: remove bogus check

`bgp` pointer always exists and is used before this function call.

Calling `free` in `json` in this context will also cause a
use-after-free crash.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2021-10-11 18:29:54 -03:00
parent 690c3134a4
commit 21e33c958d

View File

@ -13426,16 +13426,6 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
bgp = peer->bgp;
if (!bgp) {
if (use_json) {
json_object_string_add(json, "alert", "no BGP");
vty_out(vty, "%s\n", json_object_to_json_string(json));
json_object_free(json);
} else
vty_out(vty, "%% No bgp\n");
return;
}
subgrp = peer_subgroup(peer, afi, safi);
if (type == bgp_show_adj_route_advertised && subgrp