PR: 2385
authorDr. Stephen Henson <steve@openssl.org>
Tue, 30 Nov 2010 19:37:33 +0000 (19:37 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 30 Nov 2010 19:37:33 +0000 (19:37 +0000)
Submitted by: Stefan Birrer <stefan.birrer@adnovum.ch>
Reviewed by: steve

Zero key->pkey.ptr after it is freed so the structure can be reused.

crypto/evp/p_lib.c

index 1916c616991f9f36fcf6e2f366cc01ae0934690c..e26ccd0d086a5f390cde8b397540f7565100d5a7 100644 (file)
@@ -411,7 +411,10 @@ void EVP_PKEY_free(EVP_PKEY *x)
 static void EVP_PKEY_free_it(EVP_PKEY *x)
        {
        if (x->ameth && x->ameth->pkey_free)
+               {
                x->ameth->pkey_free(x);
+               x->pkey.ptr = NULL;
+               }
 #ifndef OPENSSL_NO_ENGINE
        if (x->engine)
                {