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

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


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

commit 00d773d0349f8e9afcbe6be4562093a363f6e23c
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 c2c66197f7..1e8ee4340e 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]

Reply via email to