summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/evp/digest.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2016-05-03 18:50:10 +0000
committerjkim <jkim@FreeBSD.org>2016-05-03 18:50:10 +0000
commit00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced (patch)
tree64905eaaef6c163463b7acbaca1a9724913735f5 /crypto/openssl/crypto/evp/digest.c
parentc052df1347dcbd00de507acf0cfa03733e795db5 (diff)
parentacb827e3083196de4c00b67ac9ae3bf860ffd4a9 (diff)
downloadFreeBSD-src-00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced.zip
FreeBSD-src-00a878d06ed0d3bdfbf6339ef29f6cc94fd47ced.tar.gz
Merge OpenSSL 1.0.2h.
Relnotes: yes
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