aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/evp/digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/evp/digest.c')
-rw-r--r--openssl/crypto/evp/digest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/openssl/crypto/evp/digest.c b/openssl/crypto/evp/digest.c
index 6fc469f9c..d14e8e48d 100644
--- a/openssl/crypto/evp/digest.c
+++ b/openssl/crypto/evp/digest.c
@@ -366,8 +366,11 @@ int EVP_Digest(const void *data, size_t count,
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
{
- EVP_MD_CTX_cleanup(ctx);
- OPENSSL_free(ctx);
+ if (ctx)
+ {
+ EVP_MD_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
+ }
}
/* This call frees resources associated with the context */