summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-06-08 16:01:56 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-06-08 16:03:31 +0200
commit08df5b3b44b49366d3ce0976c9215fcd78d0cec1 (patch)
tree0e2893e8353ce047af1d717488e18b327af27bc9 /ospfd
parentMerge pull request #8778 from idryzhov/fix-zebra-vrf (diff)
downloadfrr-08df5b3b44b49366d3ce0976c9215fcd78d0cec1.tar.xz
frr-08df5b3b44b49366d3ce0976c9215fcd78d0cec1.zip
ospfd: fix memory leaks in summarization
To reproduce the issue: 1. Create summary-address: `summary-address 1.1.1.0/24`. 2. Try to delete it with the wrong tag: `no summary-address 1.1.1.0/24 tag 1`. Each time this command is executed, route_node_lookup is called which locks route node one more time. As the tag is wrong, the function return immediately without unlock. 3. Finally delete the summary-address: `no summary-address 1.1.1.0/24`. The route node won't be deleted. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_asbr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index bda00e0c9..2fd195bb6 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -508,7 +508,6 @@ static void ospf_external_aggr_delete(struct ospf *ospf, struct route_node *rn)
rn->info = NULL;
route_unlock_node(rn);
- route_unlock_node(rn);
}
struct ospf_external_aggr_rt *
@@ -1160,6 +1159,7 @@ int ospf_asbr_external_aggregator_unset(struct ospf *ospf,
rn = route_node_lookup(ospf->rt_aggr_tbl, (struct prefix *)p);
if (!rn)
return OSPF_INVALID;
+ route_unlock_node(rn);
aggr = rn->info;
@@ -1217,6 +1217,7 @@ int ospf_asbr_external_rt_advertise(struct ospf *ospf, struct prefix_ipv4 *p)
rn = route_node_lookup(ospf->rt_aggr_tbl, (struct prefix *)p);
if (!rn)
return OSPF_INVALID;
+ route_unlock_node(rn);
aggr = rn->info;