From 1acd5817c26dde769a9c26c169ede8b4c4c076e5 Mon Sep 17 00:00:00 2001 From: "leonid.marushevskiy" Date: Mon, 23 Dec 2013 11:19:11 +0200 Subject: [PATCH] VERACODE-658: fix of CWE ID 404 improper resource shutdown or release in QuartzComponent --- .../apache/camel/component/quartz/QuartzComponent.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java index f852115347b53..46ec6daba4f57 100644 --- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java +++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Properties; import java.util.concurrent.atomic.AtomicInteger; +import javax.imageio.stream.FileImageOutputStream; import org.apache.camel.CamelContext; import org.apache.camel.StartupListener; @@ -435,7 +436,13 @@ protected Properties loadProperties() throws SchedulerException { answer.load(is); } catch (IOException e) { throw new SchedulerException("Error loading Quartz properties file from classpath: " + getPropertiesFile(), e); - } + } finally { + try { + is.close(); + } catch (IOException ex) { + LOG.warn("Error closing quartz.properties input stream"); + } + } } return answer; }