Skip to content
Commit 43c6df5f authored by Robert Lubos's avatar Robert Lubos Committed by Carles Cufí
Browse files

net: route: Fix struct net_route_nexthop leak



When new route is allocated, a corresponding NBR entry (containing
`struct net_route_nexthop` data) is allocated from
`net_route_nexthop_pool`. When the route was deleted however, the entry
was not freed - only the "core" neighbor entry from the neighbor
management module (nbr.c) was dereferenced. This lead to a resource
leak, effecitevly leaking one `net_route_nexthop_pool` entry for each
deleted route.

Fix this, by defreferencing the NBR entry corresponding to the `struct
net_route_nexthop` data of the deleted route when route is removed.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 6fe1c904
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment