openssl_mutexes_ leaked from setup_openssl_threading()
On moria1, I found this leak:
==7518== 1,872 (312 direct, 1,560 indirect) bytes in 1 blocks are definitely lost in loss record 29 of 32
==7518== at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==7518== by 0x501A87: tor_malloc_ (util.c:162)
==7518== by 0x50BC5A: crypto_early_init (crypto.c:3167)
==7518== by 0x42B3FF: tor_init (main.c:2330)
==7518== by 0x42C55A: tor_main (main.c:2859)
==7518== by 0x5EFEC8C: (below main) (libc-start.c:228)
That line is:
openssl_mutexes_ = tor_malloc(n*sizeof(tor_mutex_t *));
which appears to only be called from crypto_early_init(), which checks this to make sure it's never called more than once:
if (!crypto_early_initialized_) {
But (ah ha), what sets crypto_early_initialized_ to 1 afterwards?