[packages] quagga: Remove libpthread dependency and bogus make flags
[openwrt/svn-archive/archive.git] / net / quagga / patches / 999-PW-8261-memleak_del_community.patch
1 From patchwork Mon Sep 13 15:48:11 2010
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [quagga-dev,8261] bgpd: fix memory leak when deleting a community
6 Date: Mon, 13 Sep 2010 14:48:11 -0000
7 From: Michael Lambert <lambert@psc.edu>
8 X-Patchwork-Id: 281
9 Message-Id: <20100913171959.5276EAAAC32@ebola.psc.edu>
10 To: quagga-dev@lists.quagga.net
11 Cc: lambert@psc.edu
12
13 * bgp_routemap.c: (route_set_community_delete) When deleting a
14 community in a route-map the old community was being orphaned. Like
15 the description of the same code in route_set_community, this is a
16 hack, not a true fix.
17
18 ---
19 bgpd/bgp_routemap.c | 7 +++++++
20 1 files changed, 7 insertions(+), 0 deletions(-)
21
22 --- a/bgpd/bgp_routemap.c
23 +++ b/bgpd/bgp_routemap.c
24 @@ -1487,6 +1487,13 @@ route_set_community_delete (void *rule,
25 new = community_uniq_sort (merge);
26 community_free (merge);
27
28 + /* HACK: if the old community is not intern'd,
29 + * we should free it here, or all reference to it may be lost.
30 + * Really need to cleanup attribute caching sometime.
31 + */
32 + if (old->refcnt == 0)
33 + community_free (old);
34 +
35 if (new->size == 0)
36 {
37 binfo->attr->community = NULL;