Call CONF_modules_free() before ENGINE_cleanup() in auto-deinit
authorMatt Caswell <matt@openssl.org>
Fri, 11 Mar 2016 09:52:52 +0000 (09:52 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 11 Mar 2016 13:36:57 +0000 (13:36 +0000)
commit773fd0bad487fe8f1cf722ca14cec2c4a2da3e21
tree31d942284eb1b80b90b0f4b9cd4ae64f67e5c5d3
parent71627423e57882a038e65993c948b2ec78c837a1
Call CONF_modules_free() before ENGINE_cleanup() in auto-deinit

During auto de-init we were calling ENGINE_cleanup(), and then later
CONF_modules_free(). However the latter function can end up calling
engine code, which can lead to a use of the global_engine_lock after it
has already been freed. Therefore we should swap the calling order of
these two functions.

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/init.c