X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fdigest.c;h=d14e8e48d5afa0b83aa4de5a7b544cbdae3a8054;hp=6fc469f9c452f9b9a7e43e88a8592189a259896d;hb=a6c62f0c25a756c263a80ce52afbae888028e986;hpb=ca989269a2876bae79393bd54c3e72d49975fc75 diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 6fc469f..d14e8e4 100644 --- a/crypto/evp/digest.c +++ b/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 */