diff options
author | Ben Laurie <ben@openssl.org> | 1999-01-02 19:04:27 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-01-02 19:04:27 +0000 |
commit | cdbb8c2f26574349b721b651f40f120864848059 (patch) | |
tree | 98a4670441825e670bbe7a0534b4f00d22d3b154 /crypto/asn1/x_pubkey.c | |
parent | c2245b68f593fbb34a697ab4be7bfe7a7d1963f4 (diff) |
Fix reference counting.
Diffstat (limited to 'crypto/asn1/x_pubkey.c')
-rw-r--r-- | crypto/asn1/x_pubkey.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 200817bf5b..a70f53fe6f 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -222,7 +222,11 @@ X509_PUBKEY *key; if (key == NULL) goto err; - if (key->pkey != NULL) return(key->pkey); + if (key->pkey != NULL) + { + CRYPTO_add(&key->pkey->references,1,CRYPTO_LOCK_EVP_PKEY); + return(key->pkey); + } if (key->public_key == NULL) goto err; @@ -252,6 +256,7 @@ X509_PUBKEY *key; } #endif key->pkey=ret; + CRYPTO_add(&ret->references,1,CRYPTO_LOCK_EVP_PKEY); return(ret); err: if (ret != NULL) |