diff options
author | Jason Evans <je@fb.com> | 2013-10-21 22:04:12 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2013-10-21 22:04:12 (GMT) |
commit | 1d1cee127aebc6ca25207435ddc6ae5d9bb90d41 (patch) | |
tree | f761394e43313dae5dd1b065a8c4fd971bed5d4d /src/jemalloc.c | |
parent | e2985a23819670866c041ba07964099eeb9e0e07 (diff) | |
download | jemalloc-1d1cee127aebc6ca25207435ddc6ae5d9bb90d41.zip jemalloc-1d1cee127aebc6ca25207435ddc6ae5d9bb90d41.tar.gz jemalloc-1d1cee127aebc6ca25207435ddc6ae5d9bb90d41.tar.bz2 |
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.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r-- | src/jemalloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index eb4bb7b..0014a34 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -745,8 +745,10 @@ malloc_init_hard(void) return (true); } - if (malloc_mutex_init(&arenas_lock)) + if (malloc_mutex_init(&arenas_lock)) { + malloc_mutex_unlock(&init_lock); return (true); + } /* * Create enough scaffolding to allow recursive allocation in |