zebra: fix use after free on RIB processing

After calling `rib_unlink` the variable `re` will point to `free()`d
memory, so don't attempt to use it after this point.

Found by Coverity Scan (Coverity ID 1519784)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2023-01-16 17:40:54 -03:00
parent 2273550f04
commit e96817f877

View File

@ -1306,6 +1306,7 @@ static void rib_process(struct route_node *rn)
vrf),
vrf_id, rn);
rib_unlink(rn, re);
continue;
} else
SET_FLAG(re->status,
ROUTE_ENTRY_REMOVED);