Automatically free up dynamically allocated public key methods when
[openssl.git] / crypto / engine / eng_lib.c
index 7b3686ddc0e42a47bd18fb8431cde3212c53327e..6ee8a90c158c98d5c4229449f3a5918935f1f887 100644 (file)
@@ -108,7 +108,7 @@ int engine_free_util(ENGINE *e, int locked)
 
        if(e == NULL)
                {
-               ENGINEerr(ENGINE_F_ENGINE_FREE,
+               ENGINEerr(ENGINE_F_ENGINE_FREE_UTIL,
                        ERR_R_PASSED_NULL_PARAMETER);
                return 0;
                }
@@ -125,6 +125,8 @@ int engine_free_util(ENGINE *e, int locked)
                abort();
                }
 #endif
+       /* Free up any dynamically allocated public key methods */
+       engine_pkey_meths_free(e);
        /* Give the ENGINE a chance to do any structural cleanup corresponding
         * to allocation it did in its constructor (eg. unload error strings) */
        if(e->destroy)