diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 03088ca23deb..4895ddbc7308 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -2357,7 +2357,7 @@ static void route_aspath_exclude_free(void *rule) if (ase->exclude_aspath_acl) { acl = ase->exclude_aspath_acl; as_list_list_del(&acl->exclude_rule, ase); - } else { + } else if (ase->exclude_aspath_acl_name) { /* no ref to acl, this aspath exclude is orphan */ as_exclude_remove_orphan(ase); }