From: Denil Vira Date: Tue, 11 Aug 2015 18:31:52 +0000 (-0700) Subject: Fix memory leak in bgpd/bgp_route.c X-Git-Tag: frr-2.0-rc1~1284 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=610f23cfff4f323a8a82657ff670187ad714a0fb;p=matthieu%2Ffrr.git Fix memory leak in bgpd/bgp_route.c 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. --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9e02b311e7..24ebdaaa6a 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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