Skip to content

Commit e854af7

Browse files
committed
Free certificate chain in case of error
1 parent 68a3c2e commit e854af7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ public boolean addCertificate(SSLHostConfigCertificate certificate, Arena localA
12951295
}
12961296
if (SSL_CTX_add0_chain_cert(state.sslCtx, x509certChain) <= 0) {
12971297
logLastError("openssl.errorAddingCertificate");
1298+
X509_free(x509certChain);
12981299
return false;
12991300
}
13001301
}

webapps/docs/changelog.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@
312312
Free CA certificate after calling <code>SSL_CTX_add_client_CA</code>
313313
in the FFM code. Based on code from PR 44 from tomcat-native. (remm)
314314
</fix>
315+
<fix>
316+
Free certificate chain if an error occurs, in the FFM code. (remm)
317+
</fix>
315318
</changelog>
316319
</subsection>
317320
<subsection name="Jasper">

0 commit comments

Comments
 (0)