This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 2851851af9 Free certificate chain in case of error
2851851af9 is described below
commit 2851851af9188d3bc4964621a71a0762e8d29ecd
Author: remm <[email protected]>
AuthorDate: Thu Mar 12 13:56:34 2026 +0100
Free certificate chain in case of error
---
java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java | 1 +
webapps/docs/changelog.xml | 3 +++
2 files changed, 4 insertions(+)
diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
index d1f65c1ed3..66d1f08db7 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
@@ -1295,6 +1295,7 @@ public class OpenSSLContext implements
org.apache.tomcat.util.net.SSLContext {
}
if (SSL_CTX_add0_chain_cert(state.sslCtx, x509certChain)
<= 0) {
logLastError("openssl.errorAddingCertificate");
+ X509_free(x509certChain);
return false;
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 64b69d1438..1b2b380891 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -214,6 +214,9 @@
Free CA certificate after calling <code>SSL_CTX_add_client_CA</code>
in the FFM code. Based on code from PR 44 from tomcat-native. (remm)
</fix>
+ <fix>
+ Free certificate chain if an error occurs, in the FFM code. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]