Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/x_pubkey.c')
-rw-r--r--crypto/x509/x_pubkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index 23534b2b..3d07d661 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -141,7 +141,8 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
CRYPTO_STATIC_MUTEX_lock_read(&g_pubkey_lock);
if (key->pkey != NULL) {
CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock);
- return EVP_PKEY_up_ref(key->pkey);
+ EVP_PKEY_up_ref(key->pkey);
+ return key->pkey;
}
CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock);
@@ -170,7 +171,8 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
}
OPENSSL_free(spki);
- return EVP_PKEY_up_ref(ret);
+ EVP_PKEY_up_ref(ret);
+ return ret;
error:
OPENSSL_free(spki);