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 6fc469f..d14e8e4 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 */