summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/evp/digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/evp/digest.c')
-rw-r--r--crypto/openssl/crypto/evp/digest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/openssl/crypto/evp/digest.c b/crypto/openssl/crypto/evp/digest.c
index f2643f3..5b642b2 100644
--- a/crypto/openssl/crypto/evp/digest.c
+++ b/crypto/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;
OpenPOWER on IntegriCloud