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 22:52:41 +0000 (22:52 +0000)
crypto/evp/digest.c

index 6fc469f9c452f9b9a7e43e88a8592189a259896d..d14e8e48d5afa0b83aa4de5a7b544cbdae3a8054 100644 (file)
@@ -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 */