]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix EVP cleanup
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 May 2017 08:04:46 +0000 (09:04 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 May 2017 08:04:46 +0000 (09:04 +0100)
Issue: #1657

src/libserver/dkim.c

index 19478465155a83590de96292187358eb3046c150..311b293f18fe8cc47bb70750acf391507f71a96a 100644 (file)
@@ -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);