This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 6547a5c420 Free certificate chain in case of error
6547a5c420 is described below

commit 6547a5c4208cd4ee36609265fffd524881cbc77b
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 fddb1f868e..6dc64e2977 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -218,6 +218,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]

Reply via email to