diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 0925705a25..a3b414975e 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -510,7 +510,9 @@ static void handle_recursive_depend(struct nhg_connected_tree_head *nhg_depends, resolved_ng.nexthop = nh; depend = zebra_nhg_rib_find(0, &resolved_ng, afi); - depends_add(nhg_depends, depend); + + if (depend) + depends_add(nhg_depends, depend); } static bool zebra_nhg_find(struct nhg_hash_entry **nhe, uint32_t id,