diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java index 8b004765e..ff737c451 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java @@ -154,9 +154,11 @@ public class CPEAnalyzer implements Analyzer { public void close() { if (cpe != null) { cpe.close(); + cpe = null; } if (cve != null) { cve.close(); + cve = null; } } diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/EngineVersionCheck.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/EngineVersionCheck.java index 1c943d9ad..81df9557b 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/EngineVersionCheck.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/update/EngineVersionCheck.java @@ -97,7 +97,7 @@ public class EngineVersionCheck implements CachedWebDataSource { final boolean updateNeeded = shouldUpdate(lastChecked, now, properties, currentVersion); if (updateNeeded) { LOGGER.warn("A new version of dependency-check is available. Consider updating to version {}.", - updateToVersion); + updateToVersion); } } catch (DatabaseException ex) { LOGGER.debug("Database Exception opening databases to retrieve properties", ex); @@ -115,8 +115,8 @@ public class EngineVersionCheck implements CachedWebDataSource { * @param properties the database properties object * @param currentVersion the current version of dependency-check * @return true if a newer version of the database has been released; otherwise false - * @throws UpdateException thrown if there is an error connecting to the github documentation site or accessing the - * local database. + * @throws UpdateException thrown if there is an error connecting to the github documentation site or accessing the local + * database. */ protected boolean shouldUpdate(final long lastChecked, final long now, final DatabaseProperties properties, String currentVersion) throws UpdateException { @@ -172,6 +172,7 @@ public class EngineVersionCheck implements CachedWebDataSource { if (cveDB != null) { try { cveDB.close(); + cveDB = null; } catch (Throwable ignore) { LOGGER.trace("Error closing the cveDB", ignore); }