mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user