diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-09-10 15:22:47 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-09-11 18:45:59 +0200 |
commit | 493075d25b1686661b89e2e6bc68cec55ed5054b (patch) | |
tree | 6a3f0af84a98ab4fd7c75475a25691f4b759887e /bgpd/bgp_nexthop.c | |
parent | bgpd: bgp_cleanup_routes ensure dest is not freed (diff) | |
download | frr-493075d25b1686661b89e2e6bc68cec55ed5054b.tar.xz frr-493075d25b1686661b89e2e6bc68cec55ed5054b.zip |
bgpd: bgp_connected_delete needs to ensure dest is still there
Again coverity believes that dest could be freed by a call
into bgp_dest_unlock_node, and it can if the lock count
is wrong. Let's fix that assumption for coverity
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 6cb6d65c6..367c7056f 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -483,7 +483,9 @@ void bgp_connected_delete(struct bgp *bgp, struct connected *ifc) XFREE(MTYPE_BGP_CONN, bc); bgp_dest_set_bgp_connected_ref_info(dest, NULL); } - bgp_dest_unlock_node(dest); + + dest = bgp_dest_unlock_node(dest); + assert(dest); bgp_dest_unlock_node(dest); } |