]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix memory leak when an SRv6 SID is removed
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Tue, 23 Aug 2022 22:02:22 +0000 (00:02 +0200)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Wed, 24 Aug 2022 06:56:46 +0000 (08:56 +0200)
commitbda15542f425bff67b4f821f2e475f4e330696dd
tree60a3e6bd76d8b0a000dfae577587bf8c14ef202c
parent03852f673b571fc7f5d815a3f00429533f38d2aa
bgpd: Fix memory leak when an SRv6 SID is removed

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 SIDs are removed in bgpd: when
an SRv6 locator is deleted/unset, all the SIDs allocated from that
locator are removed from the SRv6 functions list
(`bgp->srv6_functions`),but the memory allocated for the SIDs is not
freed.

This patch adds a call to `XFREE()` to properly free the allocated
memory when an SRv6 SID is removed.

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