]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: opsf_abr.c memory leak fix, free range 13479/head
authorJeevesh Rishi Dindyal (Sarvesh) <68096721+ryndia@users.noreply.github.com>
Tue, 9 May 2023 09:59:58 +0000 (13:59 +0400)
committerryndia <dindyalsarvesh@gmail.com>
Wed, 10 May 2023 06:59:20 +0000 (10:59 +0400)
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>
ospfd/ospf_abr.c

index ded520889f4f9f03419e5acae54674d9560f2ff1..28d526870b805cc923dffc9565cbc0b87918d032 100644 (file)
@@ -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;
 }