diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-14 14:41:56 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-05-14 14:41:56 -0700 |
commit | 4ba1c78bc8f45e6179dd612fcbdd7a1bba18b819 (patch) | |
tree | 196bb982fdb9028de821a745679fa40af9875428 /bgpd/bgp_route.c | |
parent | 9fb3006d10c38f7337a705e82dd36bd3a963fa39 (diff) | |
download | quagga-4ba1c78bc8f45e6179dd612fcbdd7a1bba18b819.tar.bz2 quagga-4ba1c78bc8f45e6179dd612fcbdd7a1bba18b819.tar.xz |
Reference count BGP instance
Bug 3436
Add reference counting on BGP structure. Don't free BGP instance until
all peer's are deleted.
Fix memory leak where self reference created but never freed
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6da17d9b..80ae0793 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1529,6 +1529,7 @@ bgp_processq_del (struct work_queue *wq, void *data) { struct bgp_process_queue *pq = data; + bgp_unlock(pq->bgp); bgp_unlock_node (pq->rn); XFREE (MTYPE_BGP_PROCESS_QUEUE, pq); } @@ -1578,6 +1579,7 @@ bgp_process (struct bgp *bgp, struct bgp_node *rn, afi_t afi, safi_t safi) pqnode->rn = bgp_lock_node (rn); /* unlocked by bgp_processq_del */ pqnode->bgp = bgp; + bgp_lock(bgp); pqnode->afi = afi; pqnode->safi = safi; |