From 35f352c457488d9ae49dc5e1d1ea59c46b56c3a4 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 10 Sep 2023 09:19:05 -0400 Subject: [PATCH] bgpd: bgp_evpn_es_route_del_all should not free dest until after looping Again the dest pointer should be still locked by the table walk. Ensure that coverity is happy that this is not happening. Signed-off-by: Donald Sharp --- bgpd/bgp_evpn_mh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 7700281cd2..ffb1b17ec7 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -323,7 +323,9 @@ static void bgp_evpn_es_route_del_all(struct bgp *bgp, struct bgp_evpn_es *es) for (pi = bgp_dest_get_bgp_path_info(dest); (pi != NULL) && (nextpi = pi->next, 1); pi = nextpi) { bgp_path_info_delete(dest, pi); - bgp_path_info_reap(dest, pi); + dest = bgp_path_info_reap(dest, pi); + + assert(dest); } } } -- 2.39.5