bgpd: fix crash when bgp_delete found by unit-test

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
This commit is contained in:
Hiroki Shirokura 2020-12-29 08:23:34 +00:00 committed by Mark Stapp
parent daedb8b3cf
commit 124f7236fb

View File

@ -1337,8 +1337,10 @@ static void bgp_srv6_init(struct bgp *bgp)
static void bgp_srv6_cleanup(struct bgp *bgp)
{
list_delete(&bgp->srv6_locator_chunks);
list_delete(&bgp->srv6_functions);
if (bgp->srv6_locator_chunks)
list_delete(&bgp->srv6_locator_chunks);
if (bgp->srv6_functions)
list_delete(&bgp->srv6_functions);
}
/* Allocate new peer object, implicitely locked. */