From ab798674c0e008c68f344c79011ed46cb5792a11 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 8 Sep 2021 21:08:08 +0300 Subject: [PATCH] bgpd: fix aspath memory leak We allocate an as-path using bgp_attr_default_set and should free it before exiting the function. Signed-off-by: Igor Ryzhov --- 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 2b1f186790..3b7ee8b0b6 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -935,6 +935,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) subgroup_default_update_packet(subgrp, new_attr, from); } } + + aspath_unintern(&attr.aspath); } /*