From: Vsevolod Stakhov Date: Tue, 30 May 2017 08:04:46 +0000 (+0100) Subject: [Minor] Fix EVP cleanup X-Git-Tag: 1.6.0~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea4b010734ca734804a0a4520b8b4720db59f10b;p=rspamd.git [Minor] Fix EVP cleanup Issue: #1657 --- diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 194784651..311b293f1 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -2198,12 +2198,14 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx, } } + if (cpy_ctx) { #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - EVP_MD_CTX_cleanup (cpy_ctx); + EVP_MD_CTX_cleanup (cpy_ctx); #else - EVP_MD_CTX_reset (cpy_ctx); + EVP_MD_CTX_reset (cpy_ctx); #endif - EVP_MD_CTX_destroy (cpy_ctx); + EVP_MD_CTX_destroy (cpy_ctx); + } } dlen = EVP_MD_CTX_size (ctx->common.headers_hash);