mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 15:10:38 +00:00
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:
parent
690c3134a4
commit
21e33c958d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user