]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix crash when bgp_delete found by unit-test
authorHiroki Shirokura <slank.dev@gmail.com>
Tue, 29 Dec 2020 08:23:34 +0000 (08:23 +0000)
committerMark Stapp <mjs@voltanet.io>
Wed, 2 Jun 2021 14:24:48 +0000 (10:24 -0400)
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
bgpd/bgpd.c

index 1b78be354b0b4b8c33c17bdb8b172f18f6eee47b..33429d1d780139564492e3262c6cb775e2526004 100644 (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.  */