summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
authorSteve Hill <quagga@cheesy.sackheads.org>2009-06-02 14:28:16 +0100
committerPaul Jakma <paul@quagga.net>2009-06-02 14:28:16 +0100
commitacde4b861333d799b50d6e8a53214abc0d17ede3 (patch)
treee6fa104c7bfb45043aec82c9cab3941cb09459bd /bgpd/bgpd.c
parent5012bc3d217f4fff5759745ee689869fb5224b41 (diff)
[bgp] Fix crash on SIGHUP, deref of freed workqueues
* lib/workqueue.c: free-ing workqueues had never been tested obviously, queue's thread was not being stopped * bgpd/bgpd.c: null out freed workqueues, to prevent acting on freed workqueues
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index cebde0a4..1712c719 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -5150,9 +5150,15 @@ bgp_terminate ()
BGP_NOTIFY_CEASE_PEER_UNCONFIG);
bgp_cleanup_routes ();
+
if (bm->process_main_queue)
- work_queue_free (bm->process_main_queue);
+ {
+ work_queue_free (bm->process_main_queue);
+ bm->process_main_queue = NULL;
+ }
if (bm->process_rsclient_queue)
- work_queue_free (bm->process_rsclient_queue);
+ {
+ work_queue_free (bm->process_rsclient_queue);
+ bm->process_rsclient_queue = NULL;
+ }
}
-