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

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/main by this push:
     new 3ae6ebeaf Fix a memory leak when parsing certificates
3ae6ebeaf is described below

commit 3ae6ebeaf89cbd33bb0c72c7c1f6188f0ac49d3a
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 12 10:00:20 2026 +0000

    Fix a memory leak when parsing certificates
---
 native/src/sslcontext.c           | 3 +++
 xdocs/miscellaneous/changelog.xml | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index eb9b49ec3..332aca4fa 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -1234,6 +1234,9 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, 
addClientCACertificateRaw)(TCN_STDARGS,
         rv = JNI_FALSE;
     }
 
+    if (cert != NULL) {
+        X509_free(cert);
+    }
     free(charCert);
     return rv;
 }
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 635c728ce..87ff4027a 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,10 @@
 </section>
 <section name="2.0.15" rtext="developement in progress">
   <changelog>
+    <fix>
+      Fix a memory leak when parsing certificates. Pull request <pr>44</pr>
+      provided by chenjp. (markt)
+    </fix>
   </changelog>
 </section>
 <section name="2.0.14" rtext="2026-03-10">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to