From ae1f8c54c33d101f45663a013025a5e177e62409 Mon Sep 17 00:00:00 2001 From: Rodrigo Nardi Date: Mon, 26 Jun 2023 07:23:46 -0300 Subject: [PATCH] bgp: Using variable after free --- bgpd/bgp_bfd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 21864cf1a6..dcc707452a 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -320,8 +320,10 @@ static void bgp_peer_remove_bfd(struct peer *p) return; } - if (p->bfd_config) - bfd_sess_free(&p->bfd_config->session); + if (p->bfd_config) { + bfd_sess_free(&p->bfd_config->session); + p->bfd_config->manual = false; + } XFREE(MTYPE_BFD_CONFIG, p->bfd_config); }