summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-09-09 22:26:50 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-09-10 01:14:45 +0200
commit67a9da92a1836a397456f8e8e0f9a9eee9dd4715 (patch)
tree8b7759860d83ea957bdded1c287a3d623f0b9bb3 /bgpd/bgp_routemap.c
parentMerge pull request #11922 from anlancs/fix/zebra-broken-evpn (diff)
downloadfrr-67a9da92a1836a397456f8e8e0f9a9eee9dd4715.tar.xz
frr-67a9da92a1836a397456f8e8e0f9a9eee9dd4715.zip
bgpd: Fix memory leak for `set as-path replace` route-map command
==1174993== 252 (120 direct, 132 indirect) bytes in 3 blocks are definitely lost in loss record 77 of 100 ==1174993== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==1174993== by 0x493C8D5: qcalloc (memory.c:116) ==1174993== by 0x378E38: aspath_dup (bgp_aspath.c:698) ==1174993== by 0x2A39E2: route_set_aspath_replace (bgp_routemap.c:2259) ==1174993== by 0x4965C71: route_map_apply_ext (routemap.c:2664) ==1174993== by 0x27BCC8: bgp_input_modifier (bgp_route.c:1657) ==1174993== by 0x281AB9: bgp_update (bgp_route.c:3992) ==1174993== by 0x286368: bgp_nlri_parse_ip (bgp_route.c:5890) ==1174993== by 0x264D20: bgp_nlri_parse (bgp_packet.c:347) ==1174993== by 0x2682FE: bgp_update_receive (bgp_packet.c:1921) ==1174993== by 0x26AA67: bgp_process_packet (bgp_packet.c:2822) ==1174993== by 0x498F5FD: thread_call (thread.c:2008) ==1174993== by 0x49253DA: frr_run (libfrr.c:1198) ==1174993== by 0x1EEC38: main (bgp_main.c:520) Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r--bgpd/bgp_routemap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 40bbdccff..70be458c7 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2270,6 +2270,8 @@ route_set_aspath_replace(void *rule, const struct prefix *dummy, void *object)
aspath_new, replace_asn, own_asn);
}
+ aspath_free(aspath_new);
+
return RMAP_OKAY;
}