summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-09-10 15:12:26 +0200
committerDonald Sharp <sharpd@nvidia.com>2023-09-11 18:45:59 +0200
commitf491b540791dd48340f139f16381a1cfbe262049 (patch)
treeb165cb900ed02760fd9eb71afeda2699c9df3a42
parentbgpd: evpn_cleanup_local_non_best_route could free dest (diff)
downloadfrr-f491b540791dd48340f139f16381a1cfbe262049.tar.xz
frr-f491b540791dd48340f139f16381a1cfbe262049.zip
bgpd: delete_evpn_route ensure that dest is not freed before usage
There exist two spots in this function where the dest could be freed, but is not due to locking, but coverity thinks it might so let's make the function happy. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--bgpd/bgp_evpn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index ff931e1f0..6cc1dd710 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -2330,9 +2330,13 @@ static int delete_evpn_route(struct bgp *bgp, struct bgpevpn *vpn,
*/
delete_evpn_route_entry(bgp, afi, safi, dest, &pi);
if (pi) {
- bgp_path_info_reap(dest, pi);
+ dest = bgp_path_info_reap(dest, pi);
+ assert(dest);
evpn_route_select_install(bgp, vpn, dest);
}
+
+ /* dest should still exist due to locking make coverity happy */
+ assert(dest);
bgp_dest_unlock_node(dest);
return 0;