From e9b3e38f2d2d9652f77e0e6bc91f3301fb361813 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 24 Jun 2021 07:50:23 -0400 Subject: [PATCH] bgpd: Fix SA warning about freeing an aspath Fix coverity warning CID 1505589 Signed-off-by: Mark Stapp --- bgpd/bgp_updgrp_adv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 4dd7597e5f..18829aa747 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -839,6 +839,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) bgp_dest_get_prefix(dest), &tmp_pi); if (ret == RMAP_DENYMATCH) { + /* The aspath belongs to 'attr' */ + tmp_attr.aspath = NULL; bgp_attr_flush(&tmp_attr); continue; } else { -- 2.39.5