summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_mpath.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-23 01:14:21 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-10-24 23:30:30 +0200
commit44f12f209f7019c0abbec0f919cb18a136cd7bee (patch)
tree68eb68f5f5655eb8de51b4ebbde386500bd0b51b /bgpd/bgp_mpath.c
parentospfd: fix coverity warnings - security best practices violations (diff)
downloadfrr-44f12f209f7019c0abbec0f919cb18a136cd7bee.tar.xz
frr-44f12f209f7019c0abbec0f919cb18a136cd7bee.zip
*: fix coverity warnings - resource leaks
These are mostly trivial fixes for leaks in the error path of some functions. The changes in bgpd/bgp_mpath.c deserves a bit of explanation though. In the bgp_info_mpath_aggregate_update() function, we were allocating memory for the lcomm variable but doing nothing with it. Since the code for communities, extended communities and large communities is pretty much the same in this function, it's clear that this was a copy and paste error where most of the ext. community code was copied but not all of it as it should have been. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_mpath.c')
-rw-r--r--bgpd/bgp_mpath.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index d3ee140bb..9d32c4bee 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -751,6 +751,10 @@ void bgp_info_mpath_aggregate_update(struct bgp_info *new_best,
attr.ecommunity = ecomm;
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
+ if (lcomm) {
+ attr.lcommunity = lcomm;
+ attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
+ }
/* Zap multipath attr nexthop so we set nexthop to self */
attr.nexthop.s_addr = 0;