]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fix memory leak in bgpd/bgp_route.c
authorDenil Vira <denil@cumulusnetworks.com>
Tue, 11 Aug 2015 18:31:52 +0000 (11:31 -0700)
committerDenil Vira <denil@cumulusnetworks.com>
Tue, 11 Aug 2015 19:14:37 +0000 (12:14 -0700)
Ticket : CM-7047
Reviewed by : CCR-3321
Testing : Trivial

In function bgp_aggregate_add, variables 'aspath' and 'community' are
malloced but not guaranteed to be freed before the function returns.

bgpd/bgp_route.c

index 9e02b311e798359c20c704c47d49a42879c2fc04..24ebdaaa6afb50e0ff40266d44ef048c8dc75b98 100644 (file)
@@ -5741,6 +5741,13 @@ bgp_aggregate_add (struct bgp *bgp, struct prefix *p, afi_t afi, safi_t safi,
       /* Process change. */
       bgp_process (bgp, rn, afi, safi);
     }
+  else
+    {
+      if (aspath)
+       aspath_free (aspath);
+      if (community)
+       community_free (community);
+    }
 }
 
 void