summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDenil Vira <denil@cumulusnetworks.com>2015-08-11 13:34:59 -0700
committerPaul Jakma <paul@quagga.net>2015-09-24 15:26:43 +0100
commite2a9258c16bce1b3797efb9be354d20d68236194 (patch)
treef08790964b068afe0724518774dfe315a75200ca /bgpd
parent57cd5e7a2623258e1a095d63e0faaad2cddf61e8 (diff)
downloadquagga-e2a9258c16bce1b3797efb9be354d20d68236194.tar.bz2
quagga-e2a9258c16bce1b3797efb9be354d20d68236194.tar.xz
bgpd: Fix memory leak in bgpd/bgp_route.c
In function bgp_aggregate_add, variables 'aspath' and 'community' are malloced but not guaranteed to be freed before the function returns. Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 7de94615..4db2e3ea 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4888,6 +4888,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