summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-02-16 15:40:15 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-16 15:40:15 -0500
commit5d2a23397a3775eecb35bea23edffbef40b6cd94 (patch)
tree6680efe61ba7e04c346bf7f0c9238d82d17331a7 /src/common
parent7117959199a230cc7f1684794b8b13235b5f2715 (diff)
downloadtor-5d2a23397a3775eecb35bea23edffbef40b6cd94.tar.gz
tor-5d2a23397a3775eecb35bea23edffbef40b6cd94.zip
Fix a few coverity "Use after NULL check" warnings
Also remove the unit test mocks that allowed get_options() to be NULL; that's an invariant violation for get_options().
Diffstat (limited to 'src/common')
-rw-r--r--src/common/workqueue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/workqueue.c b/src/common/workqueue.c
index e9466b8124..823fb51cc9 100644
--- a/src/common/workqueue.c
+++ b/src/common/workqueue.c
@@ -371,12 +371,12 @@ threadpool_start_threads(threadpool_t *pool, int n)
while (pool->n_threads < n) {
void *state = pool->new_thread_state_fn(pool->new_thread_state_arg);
workerthread_t *thr = workerthread_new(state, pool, pool->reply_queue);
- thr->index = pool->n_threads;
if (!thr) {
tor_mutex_release(&pool->lock);
return -1;
}
+ thr->index = pool->n_threads;
pool->threads[pool->n_threads++] = thr;
}
tor_mutex_release(&pool->lock);