PR: 2385
authorDr. Stephen Henson <steve@openssl.org>
Tue, 30 Nov 2010 19:37:21 +0000 (19:37 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 30 Nov 2010 19:37:21 +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 1916c61..e26ccd0 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)
                {