From dc01a8ba034e9483ac850e53125c6417714482ab Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 10 Sep 2023 09:49:34 -0400 Subject: [PATCH] bgpd: Ensure bgp_aggregate_unset does dest good dest could be freed by the first unlock, but should not be due to our locking structure. Ensure coverity understands this. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 8320118a4e..d745f8cb78 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8235,7 +8235,8 @@ static int bgp_aggregate_unset(struct vty *vty, const char *prefix_str, bgp_dest_set_bgp_aggregate_info(dest, NULL); bgp_free_aggregate_info(aggregate); - bgp_dest_unlock_node(dest); + dest = bgp_dest_unlock_node(dest); + assert(dest); bgp_dest_unlock_node(dest); return CMD_SUCCESS; -- 2.39.5