diff options
author | Pat Ruddy <pat@voltanet.io> | 2021-05-25 10:38:26 +0200 |
---|---|---|
committer | Pat Ruddy <pat@voltanet.io> | 2021-05-27 13:57:25 +0200 |
commit | de4a0bdaa6d8dbdea3cbe96056e3c0cbbbf9619b (patch) | |
tree | e8fdfe1c24637be0c00112a95c03c865a5bfcc01 /ospf6d/ospf6_abr.c | |
parent | Merge pull request #8738 from gromit1811/bugfix_ospf6_set_tag (diff) | |
download | frr-de4a0bdaa6d8dbdea3cbe96056e3c0cbbbf9619b.tar.xz frr-de4a0bdaa6d8dbdea3cbe96056e3c0cbbbf9619b.zip |
ospf6: fix memory leak in ospf6_abr_examin_summary
Ensure that if allocated route is not added to a table then it is
deleted to avoid leaking memory.
Add a new memory type for route table so that ospf6 routes can be
distinguished in the show memory output in isolation.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r-- | ospf6d/ospf6_abr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 286e64278..1af8aed1a 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -1224,8 +1224,6 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa) if (table->hook_add) (*table->hook_add)(old_route); - /* Delete new route */ - ospf6_route_delete(route); break; } @@ -1253,7 +1251,9 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa) listnode_add_sort(route->paths, path); /* ospf6_ia_add_nw_route (table, &prefix, route); */ ospf6_route_add(route, table); - } + } else + /* if we did not add the route remove it */ + ospf6_route_delete(route); } void ospf6_abr_examin_brouter(uint32_t router_id, struct ospf6_route *route, |