diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-07-14 03:46:40 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-07-14 19:42:48 +0200 |
commit | 373de4b5b05837bc5768084fae824d9d68ce3a7c (patch) | |
tree | b88cd5adb0ea2385477feb61286a508a17fb340a /bgpd/bgp_bfd.c | |
parent | Merge pull request #9041 from taspelund/next-hop-self-force-doc (diff) | |
download | frr-373de4b5b05837bc5768084fae824d9d68ce3a7c.tar.xz frr-373de4b5b05837bc5768084fae824d9d68ce3a7c.zip |
bgpd: fix crash during configuration removal
Test the BFD config pointer before trying to free the session as it
might not exist.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_bfd.c')
-rw-r--r-- | bgpd/bgp_bfd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index f6f2f5f6e..4995f9a1f 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -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); } |