summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeevesh Rishi Dindyal (Sarvesh) <68096721+ryndia@users.noreply.github.com>2023-05-09 13:59:58 +0400
committerryndia <dindyalsarvesh@gmail.com>2023-05-10 10:59:20 +0400
commitc824d9792e1c2fd4f531c046a59627ce74a9b115 (patch)
tree5bb225cee130d7fc2163c64b06ff3831f494c4ad
parent911bfbf5f1c1b19d03b19e64fc926509987022d8 (diff)
ospfd: opsf_abr.c memory leak fix, free range
The new create range attribute is send to add to ranges, but not use if the prefix already exist in the ranges. Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
-rw-r--r--ospfd/ospf_abr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index ded520889f..28d526870b 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -66,9 +66,11 @@ static void ospf_area_range_add(struct ospf_area *area,
apply_mask_ipv4(&p);
rn = route_node_get(ranges, (struct prefix *)&p);
- if (rn->info)
+ if (rn->info) {
route_unlock_node(rn);
- else
+ ospf_area_range_free(rn->info);
+ rn->info = range;
+ } else
rn->info = range;
}