Fix a possible leak on NETSCAPE_SPKI_verify failure.
authorFdaSilvaYY <fdasilvayy@gmail.com>
Sun, 3 Apr 2016 21:37:58 +0000 (23:37 +0200)
committerFdaSilvaYY <fdasilvayy@gmail.com>
Mon, 4 Apr 2016 18:38:15 +0000 (20:38 +0200)
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
apps/ca.c

index 85766cc..cc74c5b 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -2071,6 +2071,7 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey,
 
     j = NETSCAPE_SPKI_verify(spki, pktmp);
     if (j <= 0) {
+        EVP_PKEY_free(pktmp);
         BIO_printf(bio_err,
                    "signature verification failed on SPKAC public key\n");
         goto end;