Add a missing mutex unlock in malloc_init_hard() error path.

Add a missing mutex unlock in a malloc_init_hard() error path (failed
mutex initialization).  In practice this bug was very unlikely to ever
trigger, but if it did, application deadlock would likely result.

Reported by Pat Lynch.
This commit is contained in:
Jason Evans 2013-10-21 15:04:12 -07:00
parent e2985a2381
commit 1d1cee127a

View File

@ -745,8 +745,10 @@ malloc_init_hard(void)
return (true); return (true);
} }
if (malloc_mutex_init(&arenas_lock)) if (malloc_mutex_init(&arenas_lock)) {
malloc_mutex_unlock(&init_lock);
return (true); return (true);
}
/* /*
* Create enough scaffolding to allow recursive allocation in * Create enough scaffolding to allow recursive allocation in