[Spice-devel] [PATCH 1/2] Avoids to initialise OpenSSL threading twice
Pavel Grunt
pgrunt at redhat.com
Thu Aug 11 13:40:09 UTC 2016
Ack
On Thu, 2016-08-11 at 14:22 +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/reds.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/server/reds.c b/server/reds.c
> index 6f88649..f74c8d3 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2792,6 +2792,13 @@ static void openssl_thread_setup(void)
> {
> int i;
>
> + /* Somebody else already setup threading for OpenSSL,
> + * don't do it twice to avoid possible races.
> + */
> + if (CRYPTO_get_locking_callback() != NULL) {
> + return;
> + }
> +
> lock_cs = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
>
> for (i = 0; i < CRYPTO_num_locks(); i++) {
More information about the Spice-devel
mailing list