Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Fix memory leak for default-originate with route-map #15120

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented Jan 8, 2024

Closes #15113

```
Direct leak of 40 byte(s) in 1 object(s) allocated from:
    0 0x7fc4b81eed28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    1 0x7fc4b7bd60bb in qcalloc lib/memory.c:105
    2 0x56221dc19207 in aspath_dup bgpd/bgp_aspath.c:689
    3 0x56221daacd42 in route_set_aspath_prepend bgpd/bgp_routemap.c:2283
    4 0x7fc4b7c3891a in route_map_apply_ext lib/routemap.c:2687
    5 0x56221dace552 in subgroup_default_originate bgpd/bgp_updgrp_adv.c:906
    6 0x56221dabf79c in update_group_default_originate_route_map_walkcb bgpd/bgp_updgrp.c:2105
    7 0x56221dabde4e in update_group_walkcb bgpd/bgp_updgrp.c:1721
    8 0x7fc4b7b9d398 in hash_walk lib/hash.c:270
    9 0x56221dac94cb in update_group_af_walk bgpd/bgp_updgrp.c:2062
    10 0x56221dac9b0f in update_group_walk bgpd/bgp_updgrp.c:2071
    11 0x56221dac9fd5 in update_group_refresh_default_originate_route_map bgpd/bgp_updgrp.c:2118
    12 0x7fc4b7c7fc54 in event_call lib/event.c:1974
    13 0x7fc4b7bb9276 in frr_run lib/libfrr.c:1214
    14 0x56221d9217fd in main bgpd/bgp_main.c:510
    15 0x7fc4b6bf2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
```

tmp_pi.attr should be flushed since it's already interned (new_attr) or the
origin value is used (attr).

Signed-off-by: Donatas Abraitis <[email protected]>
@donaldsharp
Copy link
Member

can you reference #15113

@donaldsharp donaldsharp merged commit 92d0242 into FRRouting:master Jan 9, 2024
11 checks passed
@ton31337 ton31337 deleted the fix/memory_leak_for_default_originate branch January 9, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASAN memory leak in bgpd
2 participants