Merge pull request #14757 from ryndia/aspath_fix

bgpd:aspath leak fix
This commit is contained in:
Russ White 2023-11-21 10:39:59 -05:00 committed by GitHub
commit 86fb83c68b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1407,7 +1407,8 @@ struct aspath *aspath_remove_private_asns(struct aspath *aspath, as_t peer_asn)
last_new_seg = new_seg; last_new_seg = new_seg;
seg = seg->next; seg = seg->next;
} }
if (!aspath->refcnt)
aspath_free(aspath);
aspath_str_update(new, false); aspath_str_update(new, false);
return new; return new;
} }