From: markt Date: Tue, 24 Nov 2009 01:15:19 +0000 (+0000) Subject: Explicitly close the stream. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e853dad07af8e10ba4d7549fb05c0de5d21d5516;p=tomcat7.0 Explicitly close the stream. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@883562 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/util/ExtensionValidator.java b/java/org/apache/catalina/util/ExtensionValidator.java index 5fed5ac29..19c561aaf 100644 --- a/java/org/apache/catalina/util/ExtensionValidator.java +++ b/java/org/apache/catalina/util/ExtensionValidator.java @@ -188,7 +188,8 @@ public final class ExtensionValidator { continue; } Resource resource = (Resource) obj; - Manifest jmanifest = getManifest(resource.streamContent()); + inputStream = resource.streamContent(); + Manifest jmanifest = getManifest(inputStream); if (jmanifest != null) { ManifestResource mre = new ManifestResource( binding.getName(), @@ -200,6 +201,14 @@ public final class ExtensionValidator { } catch (NamingException nex) { // Jump out of the check for this application because it // has no resources + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (Throwable t) { + // Ignore + } + } } return validateManifestResources(appName, appManifestResources);