fix memory leak in ca
authorDr. Stephen Henson <steve@openssl.org>
Tue, 5 Apr 2016 13:06:28 +0000 (14:06 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 5 Apr 2016 13:06:39 +0000 (14:06 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
apps/ca.c

index cc74c5b..d2990a5 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1788,7 +1788,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
     if (!X509_set_subject_name(ret, subject))
         goto end;
 
-    pktmp = X509_REQ_get_pubkey(req);
+    pktmp = X509_REQ_get0_pubkey(req);
     i = X509_set_pubkey(ret, pktmp);
     if (!i)
         goto end;