Guard against null dereference when no workers are running

This commit is contained in:
Frederick F. Kautz IV 2017-02-27 18:30:58 -08:00
parent 6f7247464c
commit 9dd266e85a
1 changed files with 4 additions and 0 deletions

View File

@ -1875,6 +1875,10 @@ void workers_stop(int stop_all)
* It's cool enough to be able to reconfigure at all.
*/
w = worker_threads;
if (w == NULL) {
hlog(LOG_CRIT, "Cannot stop worker threads, none running");
abort();
}
while ((w) && (w->next))
w = w->next;