From 62f0afa2ecead02b1258dabab8097ca278a22f8f Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Wed, 21 Sep 2016 20:29:42 -0400 Subject: Import upstream version 0.9+1474479173.6c180c6 --- Cryptlib/OpenSSL/crypto/evp/digest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Cryptlib/OpenSSL/crypto/evp/digest.c') diff --git a/Cryptlib/OpenSSL/crypto/evp/digest.c b/Cryptlib/OpenSSL/crypto/evp/digest.c index f2643f32..5b642b23 100644 --- a/Cryptlib/OpenSSL/crypto/evp/digest.c +++ b/Cryptlib/OpenSSL/crypto/evp/digest.c @@ -212,8 +212,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) } #endif if (ctx->digest != type) { - if (ctx->digest && ctx->digest->ctx_size) + if (ctx->digest && ctx->digest->ctx_size) { OPENSSL_free(ctx->md_data); + ctx->md_data = NULL; + } ctx->digest = type; if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { ctx->update = type->update; -- cgit v1.2.3