* nmalloc was calling pthread_set_specific() prior to calling
pthread_key_create(), causing it to use key 0 which might already
have been allocated for other purposes.
* Reorder initializations in _nmalloc_thr_init() to solve the problem.
* This also solves certain application crashes (mail/milter-greylist).
Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
tp = &thread_mags;
tp->init = -1;
- pthread_setspecific(thread_mags_key, tp);
if (mtmagazine_free_live == 0) {
mtmagazine_free_live = 1;
pthread_once(&thread_mags_once, mtmagazine_init);
}
+ pthread_setspecific(thread_mags_key, tp);
tp->init = 1;
}