From: Ondrej Zajicek (work) Date: Thu, 10 Oct 2019 12:01:16 +0000 (+0200) Subject: Nest: Fix recursive route update X-Git-Tag: v2.0.7~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb2b6e0494e685fc4cce52a1d449ffd69bec351e;p=thirdparty%2Fbird.git Nest: Fix recursive route update Missing cleanup can lead to dangling pointer to old next hops. --- diff --git a/nest/rt-table.c b/nest/rt-table.c index b55bcd40d..97a5d1bc7 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2109,9 +2109,10 @@ no_nexthop: else { nhr = nhp; - nhp = (nhp ? (nhp->next = lp_allocz(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh)); + nhp = (nhp ? (nhp->next = lp_alloc(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh)); } + memset(nhp, 0, NEXTHOP_MAX_SIZE); nhp->iface = nh->iface; nhp->weight = nh->weight; if (mls)