diff options
author | Adam Langley <agl@google.com> | 2015-01-15 04:49:32 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-01-16 01:10:02 +0300 |
commit | f0eb1698291c00c60f76f8207b9fa9c079e75c12 (patch) | |
tree | 0ba7b23a6fff46adc373bd75f5102956a8d50367 /crypto/err/err_impl.c | |
parent | d749af7ab1807f28882096eeb97f0ddfc363001d (diff) |
Free all error queues on shutdown.
As feared, 2bca0988 did cause some leak checkers to get upset about the
state_hash pointer getting cleared.
This change makes err_shutdown free all the error queues to try and
avoid this. Hopefully this doesn't upset TSAN in turn.
BUG=448296
Change-Id: I827da63c793dcabc73168ece052cdcd3d3cc64e3
Reviewed-on: https://boringssl-review.googlesource.com/2890
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/err/err_impl.c')
-rw-r--r-- | crypto/err/err_impl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/err/err_impl.c b/crypto/err/err_impl.c index e448d65b..8cfcb46d 100644 --- a/crypto/err/err_impl.c +++ b/crypto/err/err_impl.c @@ -287,13 +287,14 @@ static ERR_STATE *err_release_state(const CRYPTO_THREADID *tid) { return state; } -static void err_shutdown(void) { +static void err_shutdown(void (*err_state_free_cb)(ERR_STATE*)) { CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (error_hash) { lh_ERR_STRING_DATA_free(error_hash); error_hash = NULL; } if (state_hash) { + lh_ERR_STATE_doall(state_hash, err_state_free_cb); lh_ERR_STATE_free(state_hash); state_hash = NULL; } |