This is an automated email from the ASF dual-hosted git repository. markt-asf pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a738cd063dbb41f450438a6360367d1e4e9aac95 Author: Mark Thomas <[email protected]> AuthorDate: Wed Jun 3 10:39:52 2026 +0100 Only recycle the elements that were filtered out --- java/org/apache/tomcat/util/http/MimeHeaders.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/http/MimeHeaders.java b/java/org/apache/tomcat/util/http/MimeHeaders.java index 939c64197e..7d8a1ad524 100644 --- a/java/org/apache/tomcat/util/http/MimeHeaders.java +++ b/java/org/apache/tomcat/util/http/MimeHeaders.java @@ -177,11 +177,10 @@ public class MimeHeaders { } } } + int unfilteredCount = count; count = ++j; - for (int i = count; i < headers.length; i++) { - if (headers[i] != null) { - headers[i].recycle(); - } + for (int i = count; i < unfilteredCount; i++) { + headers[i].recycle(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
