summaryrefslogtreecommitdiffstats
path: root/lib/workqueue.c
diff options
context:
space:
mode:
authorSteve Hill <quagga@cheesy.sackheads.org>2009-06-02 15:28:16 +0200
committerPaul Jakma <paul@quagga.net>2009-06-02 15:28:16 +0200
commitacde4b861333d799b50d6e8a53214abc0d17ede3 (patch)
treee6fa104c7bfb45043aec82c9cab3941cb09459bd /lib/workqueue.c
parent[release] Bump version to 0.99.12 (diff)
downloadfrr-acde4b861333d799b50d6e8a53214abc0d17ede3.tar.xz
frr-acde4b861333d799b50d6e8a53214abc0d17ede3.zip
[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 'lib/workqueue.c')
-rw-r--r--lib/workqueue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 1d32d2411..7c811edd1 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -91,6 +91,9 @@ work_queue_new (struct thread_master *m, const char *queue_name)
void
work_queue_free (struct work_queue *wq)
{
+ if (wq->thread != NULL)
+ thread_cancel(wq->thread);
+
/* list_delete frees items via callback */
list_delete (wq->items);
listnode_delete (&work_queues, wq);