From 8c9e7835ae93e2f3712a4ed48b1c2387d7aa617a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 10 Sep 2023 09:45:15 -0400 Subject: [PATCH] bgpd: bgp_static_set ensure dest is still usable. Again coverity thinks dest may be freed on the first call but it should not be. 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 b84abf262e..38324681fe 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6715,7 +6715,8 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str, } bgp_dest_set_bgp_static_info(dest, NULL); - bgp_dest_unlock_node(dest); + dest = bgp_dest_unlock_node(dest); + assert(dest); bgp_dest_unlock_node(dest); } else { dest = bgp_node_get(table, &p);