]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Fix memory leak in SRv6 locator delete/unset
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Tue, 23 Aug 2022 21:55:05 +0000 (23:55 +0200)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Wed, 24 Aug 2022 06:53:08 +0000 (08:53 +0200)
commit03852f673b571fc7f5d815a3f00429533f38d2aa
tree3e8c140503f7827831362b0d8023caff0cbf6285
parentd0c775e3eb749e03f8414478b5c1fd26b9a5e726
bgpd: Fix memory leak in SRv6 locator delete/unset

Running `bgp_srv6l3vpn_to_bgp_vrf` and `bgp_srv6l3vpn_to_bgp_vrf2`
topotests with `--valgrind-memleaks` gives several memory leak errors.
This is due to the way SRv6 locators are deleted/unset in bgpd: when
an SRv6 locator is deleted/unset, all the chunks of the locator are
removed from the SRv6 locator chunks list (`bgp->srv6_locator_chunks`).
However, the memory allocated for the chunks is not freed.

This patch adds a call to the `srv6_locator_chunk_free()` function to
properly free the allocated memory when an SRv6 locator is removed or
unset.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
bgpd/bgp_vty.c
bgpd/bgp_zebra.c