network/nexthop: do not share NextHop.nexthops and NextHop.routes with duplicated object
Otherwise, these may be freed twice. But, fortunately, when this function is called, both are NULL. So, this should not change any behavior. But for safety.
This commit is contained in:
@@ -261,6 +261,8 @@ static int nexthop_dup(const NextHop *src, NextHop **ret) {
|
||||
dest->network = NULL;
|
||||
dest->section = NULL;
|
||||
dest->group = NULL;
|
||||
dest->nexthops = NULL;
|
||||
dest->routes = NULL;
|
||||
|
||||
HASHMAP_FOREACH(nhg, src->group) {
|
||||
_cleanup_free_ struct nexthop_grp *g = NULL;
|
||||
|
||||
Reference in New Issue
Block a user