From 1e469d276c20f5bd23edafb1d2978290979dfdac Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 9 May 2018 16:06:40 -0400 Subject: [PATCH] bgpd: fix NHT free when nht_info is null (fixes crash) Signed-off-by: Lou Berger --- bgpd/bgp_nht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 8b6ff3fa22..2c9e379299 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -88,7 +88,7 @@ int bgp_find_nexthop(struct bgp_info *path, int connected) static void bgp_unlink_nexthop_check(struct bgp_nexthop_cache *bnc) { - if (LIST_EMPTY(&(bnc->paths)) && !bnc->nht_info) { + if (LIST_EMPTY(&(bnc->paths)) && bnc->nht_info) { if (BGP_DEBUG(nht, NHT)) { char buf[PREFIX2STR_BUFFER]; zlog_debug("bgp_unlink_nexthop: freeing bnc %s", -- 2.39.5