]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix crash during configuration removal
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 14 Jul 2021 01:46:40 +0000 (22:46 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 14 Jul 2021 17:42:48 +0000 (14:42 -0300)
Test the BFD config pointer before trying to free the session as it
might not exist.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bgpd/bgp_bfd.c

index f6f2f5f6e427e3670a56f2e687e596fcb9f01b9c..4995f9a1fd8bc4c3e73cba8d0f7851af8415d003 100644 (file)
@@ -326,7 +326,9 @@ static void bgp_peer_remove_bfd(struct peer *p)
                return;
        }
 
-       bfd_sess_free(&p->bfd_config->session);
+       if (p->bfd_config)
+               bfd_sess_free(&p->bfd_config->session);
+
        XFREE(MTYPE_BFD_CONFIG, p->bfd_config);
 }