diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-02-28 07:49:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-28 07:49:44 -0500 |
| commit | 9276144ad0c3315d0d2d93c97027f0650e562d3c (patch) | |
| tree | e87a22f237c3a1d0a18e062dddd3d0e62fdc0cfc | |
| parent | 6e6bde182d78c60f3e6751e55162e3127fba3c95 (diff) | |
| parent | 29a9aae5c3752ad4117f05351f4d36d649a2d6a4 (diff) | |
Merge pull request #12913 from opensourcerouting/fix/memory_leak_with_route_maps
bgpd: Intern attributes before putting into rib-out
| -rw-r--r-- | bgpd/bgp_updgrp_adv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 9eefd2a637..d6eb3ff20b 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -683,11 +683,14 @@ void subgroup_announce_table(struct update_subgroup *subgrp, &attr, NULL)) { /* Check if route can be advertised */ if (advertise) { - if (!bgp_check_withdrawal(bgp, dest)) + if (!bgp_check_withdrawal(bgp, dest)) { + struct attr *adv_attr = + bgp_attr_intern(&attr); + bgp_adj_out_set_subgroup( - dest, subgrp, &attr, + dest, subgrp, adv_attr, ri); - else + } else bgp_adj_out_unset_subgroup( dest, subgrp, 1, bgp_addpath_id_for_peer( |
