diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2025-03-29 12:02:11 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2025-03-30 17:54:34 -0400 |
| commit | 354aee89325f256fe92ff3af33f41da2a56ec2a1 (patch) | |
| tree | 03880244108e4c09fde227b22c143fc57c62329e /bgpd | |
| parent | f82682a3f9669fd27418f1989193339dd7623848 (diff) | |
bgpd: Free memory associated with aspath_dup
Fix this:
==3890443== 92 (48 direct, 44 indirect) bytes in 1 blocks are definitely lost in loss record 68 of 98
==3890443== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==3890443== by 0x49737B3: qcalloc (memory.c:106)
==3890443== by 0x3EA63B: aspath_dup (bgp_aspath.c:703)
==3890443== by 0x2F5438: route_set_aspath_exclude (bgp_routemap.c:2604)
==3890443== by 0x49BC52A: route_map_apply_ext (routemap.c:2708)
==3890443== by 0x2C1069: bgp_input_modifier (bgp_route.c:1925)
==3890443== by 0x2C9F12: bgp_update (bgp_route.c:5205)
==3890443== by 0x2CF281: bgp_nlri_parse_ip (bgp_route.c:7271)
==3890443== by 0x2A28C7: bgp_nlri_parse (bgp_packet.c:338)
==3890443== by 0x2A7F5C: bgp_update_receive (bgp_packet.c:2448)
==3890443== by 0x2ACCA6: bgp_process_packet (bgp_packet.c:4046)
==3890443== by 0x49EB77C: event_call (event.c:2019)
==3890443== by 0x495FAD1: frr_run (libfrr.c:1247)
==3890443== by 0x208D6D: main (bgp_main.c:557)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_routemap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index c7c8f157ca..15ad921ad0 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -2615,6 +2615,9 @@ route_set_aspath_exclude(void *rule, const struct prefix *dummy, void *object) path->attr->aspath = aspath_filter_exclude_acl(new_path, ase->exclude_aspath_acl); + else + aspath_free(new_path); + return RMAP_OKAY; } |
