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().
This commit is contained in:
Nick Mathewson
2015-02-16 15:40:15 -05:00
parent 7117959199
commit 5d2a23397a
4 changed files with 3 additions and 61 deletions
+1 -1
View File
@@ -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);