diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 631482934f..ae82a4b25f 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4265,12 +4265,11 @@ int bgp_delete(struct bgp *bgp) bgp_set_evpn(bgp_get_default()); } - if (bgp->process_queue) - work_queue_free_and_null(&bgp->process_queue); - - if (!IS_BGP_INSTANCE_HIDDEN(bgp)) + if (!IS_BGP_INSTANCE_HIDDEN(bgp)) { + if (bgp->process_queue) + work_queue_free_and_null(&bgp->process_queue); bgp_unlock(bgp); /* initial reference */ - else { + } else { for (afi = AFI_IP; afi < AFI_MAX; afi++) { enum vpn_policy_direction dir;