Skip to content

Commit aec52cb

Browse files
committed
Fix a couple more places where the key needs to be released
1 parent aa67566 commit aec52cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,11 +1071,13 @@ public boolean addCertificate(SSLHostConfigCertificate certificate, Arena localA
10711071
if (MemorySegment.NULL.equals(cert)) {
10721072
log.error(sm.getString("openssl.errorLoadingCertificateWithError",
10731073
certificate.getCertificateFile(), OpenSSLLibrary.getLastError()));
1074+
EVP_PKEY_free(key);
10741075
return false;
10751076
}
10761077
}
10771078
if (SSL_CTX_use_certificate(state.sslCtx, cert) <= 0) {
10781079
logLastError("openssl.errorLoadingCertificate");
1080+
EVP_PKEY_free(key);
10791081
X509_free(cert);
10801082
return false;
10811083
}

0 commit comments

Comments
 (0)