When reaping the dest ensure that it still exists as that
it should be locked by the calling function.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
/* reap REMOVED routes, if needs be
* selected route must stay for a while longer though
*/
- if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)
- && (pi != old_select))
- bgp_path_info_reap(dest, pi);
+ if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
+ (pi != old_select)) {
+ dest = bgp_path_info_reap(dest, pi);
+ assert(dest);
+ }
if (debug)
zlog_debug(