[quagga-dev 11094] Re: [quagga-dev, 8246, 4/4] bgpd: fix memory leak when deleting a community

Feng Lu lu.feng at 6wind.com
Tue Mar 18 03:11:06 GMT 2014


On 01/-9/-28163 03:59 AM, Michael Lambert wrote:
> * bgp_routemap.c: (route_set_community_delete) When deleting a
>    community in a route-map the old community was being orphaned.
>
> ---
> bgpd/bgp_routemap.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
> index aa7dbce..b8da186 100644
> --- a/bgpd/bgp_routemap.c
> +++ b/bgpd/bgp_routemap.c
> @@ -1484,6 +1484,7 @@ route_set_community_delete (void *rule, struct prefix *prefix,
>   	  merge = community_list_match_delete (community_dup (old), list);
>   	  new = community_uniq_sort (merge);
>   	  community_free (merge);
> +	  if (old->refcnt == 0) community_free (old);
>
>   	  if (new->size == 0)
>   	    {
Hi,

The problem has been fixed by the commit:
aa94ca8 [bug #89] Fix leak of community when set community is used

Thanks and best regards,
Feng Lu




More information about the Quagga-dev mailing list