summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x509_req.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/x509_req.c')
-rw-r--r--crypto/x509/x509_req.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c
index 8cc35b3365..b27f9f6010 100644
--- a/crypto/x509/x509_req.c
+++ b/crypto/x509/x509_req.c
@@ -92,11 +92,10 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x)))
goto err;
- pktmp = X509_get_pubkey(x);
+ pktmp = X509_get0_pubkey(x);
if (pktmp == NULL)
goto err;
i = X509_REQ_set_pubkey(ret, pktmp);
- EVP_PKEY_free(pktmp);
if (!i)
goto err;