Fix memory leak: free up ENGINE functional reference if digest is not
authorDr. Stephen Henson <steve@openssl.org>
Fri, 5 Mar 2010 13:33:43 +0000 (13:33 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 5 Mar 2010 13:33:43 +0000 (13:33 +0000)
found in an ENGINE.

crypto/evp/digest.c

index bd520456b160147309c2bb430b3e7b2841d6ea2f..982ba2b136a9a74ad04c24bf2a491d45fd3f4e84 100644 (file)
@@ -175,6 +175,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
                                {
                                /* Same comment from evp_enc.c */
                                EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
+                               ENGINE_finish(impl);
                                return 0;
                                }
                        /* We'll use the ENGINE's private digest definition */