Ignore NULL parameter in EVP_MD_CTX_destroy.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 20 Dec 2013 15:12:26 +0000 (15:12 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 20 Dec 2013 23:32:25 +0000 (23:32 +0000)
(cherry picked from commit a6c62f0c25a756c263a80ce52afbae888028e986)

crypto/evp/digest.c

index 982ba2b136a9a74ad04c24bf2a491d45fd3f4e84..782d3199a5a6acf522952082a6291e36e2a0f7b0 100644 (file)
@@ -344,8 +344,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 */