You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bgpd: fix bgp evpn memory leaks when adj-rib-in is disabled
Some bgp evpn memory contexts are not freed at the end of the bgp
process.
> =================================================================
> ==1208677==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 96 byte(s) in 2 object(s) allocated from:
> #0 0x7f93ad4b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> sonic-net#1 0x7f93ace77233 in qcalloc lib/memory.c:106
> sonic-net#2 0x563bb68f4df1 in process_type5_route bgpd/bgp_evpn.c:5084
> sonic-net#3 0x563bb68fb663 in bgp_nlri_parse_evpn bgpd/bgp_evpn.c:6302
> sonic-net#4 0x563bb69ea2a9 in bgp_nlri_parse bgpd/bgp_packet.c:347
> sonic-net#5 0x563bb69f7716 in bgp_update_receive bgpd/bgp_packet.c:2482
> sonic-net#6 0x563bb6a04d3b in bgp_process_packet bgpd/bgp_packet.c:4091
> sonic-net#7 0x7f93acf8082d in event_call lib/event.c:1996
> sonic-net#8 0x7f93ace48931 in frr_run lib/libfrr.c:1232
> sonic-net#9 0x563bb6880ae1 in main bgpd/bgp_main.c:557
> sonic-net#10 0x7f93ac829d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Actually, the bgp evpn context may noy be used if adj rib in is unused.
This may lead to memory leaks. Fix this by freeing the context in those
corner cases.
Signed-off-by: Philippe Guibert <[email protected]>
0 commit comments