]>
git.puffer.fish Git - matthieu/frr.git/commit
bgpd: fix bgp_pbr_or_filter memory leaks
Note that bgp_pbr_policyroute_add_from_zebra() and
bgp_pbr_policyroute_remove_from_zebra() are only called from
bgp_pbr_handle_entry().
> ==966967==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 40 byte(s) in 1 object(s) allocated from:
> #0 0x7fd447ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x7fd44746f8dd in qcalloc lib/memory.c:105
> #2 0x7fd44744401a in list_new lib/linklist.c:49
> #3 0x560f8c094490 in bgp_pbr_handle_entry bgpd/bgp_pbr.c:2818
> #4 0x560f8c095993 in bgp_pbr_update_entry bgpd/bgp_pbr.c:2941
> #5 0x560f8c2164f3 in bgp_zebra_announce bgpd/bgp_zebra.c:1618
> #6 0x560f8c0bd668 in bgp_process_main_one bgpd/bgp_route.c:3691
> #7 0x560f8c0be7fe in process_subq_other_route bgpd/bgp_route.c:3856
> #8 0x560f8c0bf280 in process_subq bgpd/bgp_route.c:3955
> #9 0x560f8c0bf320 in meta_queue_process bgpd/bgp_route.c:3980
> #10 0x7fd44759fdfc in work_queue_run lib/workqueue.c:282
> #11 0x7fd4475779b2 in event_call lib/event.c:2011
> #12 0x7fd447442ff1 in frr_run lib/libfrr.c:1216
> #13 0x560f8bef0a15 in main bgpd/bgp_main.c:545
> #14 0x7fd446e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> Direct leak of 40 byte(s) in 1 object(s) allocated from:
> #0 0x7fd447ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x7fd44746f8dd in qcalloc lib/memory.c:105
> #2 0x7fd44744401a in list_new lib/linklist.c:49
> #3 0x560f8c09439d in bgp_pbr_handle_entry bgpd/bgp_pbr.c:2812
> #4 0x560f8c095993 in bgp_pbr_update_entry bgpd/bgp_pbr.c:2941
> #5 0x560f8c2164f3 in bgp_zebra_announce bgpd/bgp_zebra.c:1618
> #6 0x560f8c0bd668 in bgp_process_main_one bgpd/bgp_route.c:3691
> #7 0x560f8c0be7fe in process_subq_other_route bgpd/bgp_route.c:3856
> #8 0x560f8c0bf280 in process_subq bgpd/bgp_route.c:3955
> #9 0x560f8c0bf320 in meta_queue_process bgpd/bgp_route.c:3980
> #10 0x7fd44759fdfc in work_queue_run lib/workqueue.c:282
> #11 0x7fd4475779b2 in event_call lib/event.c:2011
> #12 0x7fd447442ff1 in frr_run lib/libfrr.c:1216
> #13 0x560f8bef0a15 in main bgpd/bgp_main.c:545
> #14 0x7fd446e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> Direct leak of 4 byte(s) in 1 object(s) allocated from:
> #0 0x7fd447ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x7fd44746f8dd in qcalloc lib/memory.c:105
> #2 0x560f8c080cec in bgp_pbr_extract_enumerate_unary bgpd/bgp_pbr.c:362
> #3 0x560f8c080f7e in bgp_pbr_extract_enumerate bgpd/bgp_pbr.c:400
> #4 0x560f8c094530 in bgp_pbr_handle_entry bgpd/bgp_pbr.c:2819
> #5 0x560f8c095993 in bgp_pbr_update_entry bgpd/bgp_pbr.c:2941
> #6 0x560f8c2164f3 in bgp_zebra_announce bgpd/bgp_zebra.c:1618
> #7 0x560f8c0bd668 in bgp_process_main_one bgpd/bgp_route.c:3691
> #8 0x560f8c0be7fe in process_subq_other_route bgpd/bgp_route.c:3856
> #9 0x560f8c0bf280 in process_subq bgpd/bgp_route.c:3955
> #10 0x560f8c0bf320 in meta_queue_process bgpd/bgp_route.c:3980
> #11 0x7fd44759fdfc in work_queue_run lib/workqueue.c:282
> #12 0x7fd4475779b2 in event_call lib/event.c:2011
> #13 0x7fd447442ff1 in frr_run lib/libfrr.c:1216
> #14 0x560f8bef0a15 in main bgpd/bgp_main.c:545
> #15 0x7fd446e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> Direct leak of 4 byte(s) in 1 object(s) allocated from:
> #0 0x7fd447ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x7fd44746f8dd in qcalloc lib/memory.c:105
> #2 0x560f8c080cec in bgp_pbr_extract_enumerate_unary bgpd/bgp_pbr.c:362
> #3 0x560f8c080f7e in bgp_pbr_extract_enumerate bgpd/bgp_pbr.c:400
> #4 0x560f8c09443d in bgp_pbr_handle_entry bgpd/bgp_pbr.c:2813
> #5 0x560f8c095993 in bgp_pbr_update_entry bgpd/bgp_pbr.c:2941
> #6 0x560f8c2164f3 in bgp_zebra_announce bgpd/bgp_zebra.c:1618
> #7 0x560f8c0bd668 in bgp_process_main_one bgpd/bgp_route.c:3691
> #8 0x560f8c0be7fe in process_subq_other_route bgpd/bgp_route.c:3856
> #9 0x560f8c0bf280 in process_subq bgpd/bgp_route.c:3955
> #10 0x560f8c0bf320 in meta_queue_process bgpd/bgp_route.c:3980
> #11 0x7fd44759fdfc in work_queue_run lib/workqueue.c:282
> #12 0x7fd4475779b2 in event_call lib/event.c:2011
> #13 0x7fd447442ff1 in frr_run lib/libfrr.c:1216
> #14 0x560f8bef0a15 in main bgpd/bgp_main.c:545
> #15 0x7fd446e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>