From: Rafael Zalamena Date: Mon, 11 Oct 2021 21:29:54 +0000 (-0300) Subject: bgpd: remove bogus check X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F9903%2Fhead;p=mirror%2Ffrr.git 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 (cherry picked from commit 21e33c958d6258943796a04b9ac29838a7b41283) --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 2d6711c46d..81d3fc453b 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13090,16 +13090,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